diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-27 16:54:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-27 16:54:57 +0100 |
commit | 9012f1c5085d1e188c5536280807077890ee45ab (patch) | |
tree | 60556ee67225eb86597f2f169feb2d308e903a17 /desktop | |
parent | afe389f814cd4cfd1f3262eb354e5e309b694a38 (diff) |
valgrind: fix leaks
Diffstat (limited to 'desktop')
-rwxr-xr-x | desktop/unx/source/start.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index 9ff95533e6b1..ef191739f15c 100755 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -866,6 +866,10 @@ exec_javaldx (Args *args) if( err != osl_Process_E_None) { fprintf (stderr, "Warning: failed to launch javaldx - java may not fuction correctly\n"); + if (javaldx) + osl_freeProcessHandle(javaldx); + if (fileOut) + osl_closeFile(fileOut); return; } else { char *chomp; @@ -876,6 +880,10 @@ exec_javaldx (Args *args) if (bytes_read <= 0) { fprintf (stderr, "Warning: failed to read path from javaldx\n"); + if (javaldx) + osl_freeProcessHandle(javaldx); + if (fileOut) + osl_closeFile(fileOut); return; } newpath[bytes_read] = '\0'; @@ -889,7 +897,10 @@ exec_javaldx (Args *args) #endif extend_library_path (newpath); - osl_freeProcessHandle(javaldx); + if (javaldx) + osl_freeProcessHandle(javaldx); + if (fileOut) + osl_closeFile(fileOut); } SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) |