From d76717fe150846cb90af58ac1c6e007aeced3df1 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 15 Oct 2007 07:24:44 +0400 Subject: Correctly free memory in regfio paths (This used to be commit 97f9a90b823887e808cca96eca7a041f121e6111) --- source3/registry/regfio.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/registry') diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index 6dca0ba862..93a27700b3 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -1171,6 +1171,7 @@ out: if ( !(rb->mem_ctx = talloc_init( "read_regf_block" )) ) { regfio_close( rb ); + SAFE_FREE(rb); return NULL; } @@ -1181,6 +1182,7 @@ out: if ( (rb->fd = open(filename, flags, mode)) == -1 ) { DEBUG(0,("regfio_open: failure to open %s (%s)\n", filename, strerror(errno))); regfio_close( rb ); + SAFE_FREE(rb); return NULL; } @@ -1190,6 +1192,7 @@ out: if ( !init_regf_block( rb ) ) { DEBUG(0,("regfio_open: Failed to read initial REGF block\n")); regfio_close( rb ); + SAFE_FREE(rb); return NULL; } @@ -1202,6 +1205,7 @@ out: if ( !read_regf_block( rb ) ) { DEBUG(0,("regfio_open: Failed to read initial REGF block\n")); regfio_close( rb ); + SAFE_FREE(rb); return NULL; } -- cgit