]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix double free bugs after calling regfio_close()
authorTim Potter <tpot@samba.org>
Mon, 18 Feb 2008 09:37:33 +0000 (20:37 +1100)
committerJeremy Allison <jra@samba.org>
Thu, 21 Feb 2008 02:28:41 +0000 (18:28 -0800)
source/registry/regfio.c

index 3740ff0ee4a5d8e956fd891b6f71aa92144a2a7f..1c3aad7a2500c0207e5845051690d1d8c9c67da0 100644 (file)
@@ -1171,7 +1171,6 @@ out:
        
        if ( !(rb->mem_ctx = talloc_init( "read_regf_block" )) ) {
                regfio_close( rb );
-               SAFE_FREE(rb);
                return NULL;
        }
 
@@ -1182,7 +1181,6 @@ 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;
        }
        
@@ -1192,7 +1190,6 @@ 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;
                }
                
@@ -1205,7 +1202,6 @@ 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;
        }