diff options
Diffstat (limited to 'odk/source/unoapploader/unx/unoapploader.c')
-rw-r--r-- | odk/source/unoapploader/unx/unoapploader.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/odk/source/unoapploader/unx/unoapploader.c b/odk/source/unoapploader/unx/unoapploader.c index fb5e2dea3841..a44c01285918 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)) { |