From: Eric Bollengier Date: Tue, 19 Jan 2010 16:03:25 +0000 (+0100) Subject: Fix possible memory leak X-Git-Tag: Release-5.0.0~54 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1fc397dab51ac7a07ad7a4f8a1384ef354fb3976;p=bacula%2Fbacula Fix possible memory leak --- diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index 5586d6baf7..8991774195 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -403,7 +403,8 @@ int run_program_full_output(char *prog, int wait, POOLMEM *&results) mode = (char *)"r"; bpipe = open_bpipe(prog, wait, mode); if (!bpipe) { - return ENOENT; + stat1 = ENOENT; + goto bail_out; } sm_check(__FILE__, __LINE__, false); @@ -449,6 +450,7 @@ int run_program_full_output(char *prog, int wait, POOLMEM *&results) stat1 = stat2 != 0 ? stat2 : stat1; Dmsg1(900, "Run program returning %d\n", stat1); +bail_out: free_pool_memory(tmp); free(buf); return stat1;