]> git.sur5r.net Git - bacula/bacula/commitdiff
Free an unreleased buffer in compat code
authorKern Sibbald <kern@sibbald.com>
Fri, 4 May 2007 15:23:30 +0000 (15:23 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 4 May 2007 15:23:30 +0000 (15:23 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4694 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/win32/compat/compat.cpp
bacula/technotes-2.1

index ff808a9a87feda2e2fcf0dc83554b1a4bced0607..088bc43ad65df2aaf7febfa0bd35913d23ec9aa6 100644 (file)
@@ -1361,15 +1361,16 @@ win32_fputs(const char *string, FILE *stream)
       POOLMEM* pszBuf = get_pool_memory(PM_MESSAGE);
       pszBuf = check_pool_memory_size(pszBuf, dwChars+1);
 
-      dwChars = p_WideCharToMultiByte(GetConsoleOutputCP(),0,(LPCWSTR) pwszBuf,-1,pszBuf,dwChars,NULL,NULL);
+      dwChars = p_WideCharToMultiByte(GetConsoleOutputCP(),0,(LPCWSTR)pwszBuf,-1,pszBuf,dwChars,NULL,NULL);
       free_pool_memory(pwszBuf);
 
       if (WriteConsoleA (hOut, pszBuf, dwChars-1, &dwCharsWritten, NULL)) {
          free_pool_memory(pszBuf);
          return dwCharsWritten;
       }
+      free_pool_memory(pszBuf);
    }
-
+   /* Fall back */
    return fputs(string, stream);
 }
 
index 715e62e3040f8d7b276cd34037e55ea634312b3b..f682b5bd60b4a19bd510fcf6acdd77ad78fd175e 100644 (file)
@@ -2,6 +2,7 @@
 
 General:
 04May07
+kes  Free an unreleased buffer in compat code.
 kes  Change console Job name from *Console* to -Console- to eliminate
      Win32 filename problems.  Put Win32 path separator when creating
      Console file.  This fixes bug #846.