diff options
author | Gert Faller <gertfaller@aliceadsl.fr> | 2010-10-31 20:38:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-31 20:38:51 +0000 |
commit | 6e8b7533646f9326763f33f68f2d10b0030b698f (patch) | |
tree | e0e0de362ad401e053ed144e3d69073e7e21fa96 | |
parent | ddb49cfcbeb9bbb34ee03b03ba0818602629afef (diff) |
fix cppcheck warningsLIBREOFFICE_3_3_FREEZEfeature/pptx-export-ooxml11
-rw-r--r-- | odk/source/unoapploader/unx/unoapploader.c | 6 | ||||
-rw-r--r-- | odk/source/unoapploader/win/unoapploader.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/odk/source/unoapploader/unx/unoapploader.c b/odk/source/unoapploader/unx/unoapploader.c index 3cc214d8..a36f8fdd 100644 --- a/odk/source/unoapploader/unx/unoapploader.c +++ b/odk/source/unoapploader/unx/unoapploader.c @@ -146,13 +146,15 @@ int main( int argc, char *argv[] ) libpath = NULL; for (;;) { size_t m; - libpath = realloc(libpath, n); - if (libpath == NULL) { + char * test = realloc(libpath, n); + if (test == NULL) { fprintf( stderr, "Error: out of memory reading unoinfo output!\n"); + free(libpath); exit(EXIT_FAILURE); } + libpath = test; m = fread(libpath + old, 1, n - old - 1, f); if (m != n - old - 1) { if (ferror(f)) { diff --git a/odk/source/unoapploader/win/unoapploader.c b/odk/source/unoapploader/win/unoapploader.c index fb16aab6..b4897dff 100644 --- a/odk/source/unoapploader/win/unoapploader.c +++ b/odk/source/unoapploader/win/unoapploader.c @@ -152,13 +152,15 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, CloseHandle(procinfo.hThread); for (;;) { DWORD m; - buf = realloc(buf, n); - if (buf == NULL) { + char * test = realloc(buf, n); + if (test == NULL) { writeError( "Error: out of memory reading unoinfo output!\n"); closeErrorFile(); + free(buf); return 1; } + buf = test; if (!ReadFile(stdoutRead, buf + k, n - k, &m, NULL)) { DWORD err = GetLastError(); |