trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
Date Wed, 28 Nov 2018 23:40:43 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1750#discussion_r237304832
  
    --- Diff: win-odbc64/security_dll/native/source/secpwd.cpp ---
    @@ -217,8 +221,25 @@ SecPwd::SecPwd(const char *dir, const char* fileName,
         if(stat(certDir,&st) != 0)
             throw SecurityException(DIR_NOTFOUND, (char *)certDir);
     
    -    certFile = buildName(certDir, fileName, serverName, CER);
    -    activeCertFile = buildName(certDir, activeFileName, serverName, ACTIVE_CER);
    +    if (lcid == 0x804) // if local charset is not utf8
    +    {
    +        serverNameGBKToUtf8 = (char *)malloc(MAX_SQL_IDENTIFIER_LEN + 1);
    --- End diff --
    
    You use malloc to allocate this storage but delete to free it. This behavior is undefined
in general. It would  be better to use free() to delete it, or to use new instead of malloc.


---

Mime
View raw message