From ef3c8a948f716af6f033cf7d0e342eab562f8e47 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 19 Jan 2010 17:03:25 +0100 Subject: [PATCH] Fix possible memory leak --- bacula/src/lib/bpipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.39.5