diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-06-08 14:10:57 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-06-08 14:11:53 +0100 |
commit | 78b7f6e138c561ccc3082a93b155934b4b9c3649 (patch) | |
tree | a4453db6c7109980a766fd1e14018386fcb69dd8 /odk | |
parent | d376d6649bbdca6a5d36c8ef2a43ce3890c01d89 (diff) |
targetted revert of minor cppcheck cleanup
Change-Id: Id3100ef8f8381bc05e5a01c56fc5d611094857bf
Diffstat (limited to 'odk')
-rw-r--r-- | odk/source/unoapploader/unx/unoapploader.c | 6 | ||||
-rw-r--r-- | odk/source/unoapploader/win/unoapploader.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/odk/source/unoapploader/unx/unoapploader.c b/odk/source/unoapploader/unx/unoapploader.c index 90c1cd1493c0..e744f1be009f 100644 --- a/odk/source/unoapploader/unx/unoapploader.c +++ b/odk/source/unoapploader/unx/unoapploader.c @@ -148,15 +148,13 @@ int main( int argc, char *argv[] ) libpath = NULL; for (;;) { size_t m; - char * test = realloc(libpath, n); - if (test == NULL) { + libpath = realloc(libpath, n); + if (libpath == 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 8debafe0c25f..ca17ce7b2146 100644 --- a/odk/source/unoapploader/win/unoapploader.c +++ b/odk/source/unoapploader/win/unoapploader.c @@ -152,15 +152,13 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, CloseHandle(procinfo.hThread); for (;;) { DWORD m; - char * test = realloc(buf, n); - if (test == NULL) { + buf = realloc(buf, n); + if (buf == 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(); |