r14226: Fix Coverity bug # 109
authorVolker Lendecke <vlendec@samba.org>
Sun, 12 Mar 2006 00:03:00 +0000 (00:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:18 +0000 (11:15 -0500)
(This used to be commit e9a63e3b35822eefbc5e17b6f9a4aab5e8c03074)

source3/rpc_server/srv_reg_nt.c

index 33711d0fac91386956c8ecf05d1b461a31ad4dfb..5ac6738b9919995920afc77e41e34c42864a3fb9 100644 (file)
@@ -835,8 +835,10 @@ static WERROR restore_registry_key ( REGISTRY_KEY *krecord, const char *fname )
        /* get the rootkey from the regf file and then load the tree
           via recursive calls */
           
-       if ( !(rootkey = regfio_rootkey( regfile )) )
+       if ( !(rootkey = regfio_rootkey( regfile )) ) {
+               regfio_close( regfile );
                return WERR_REG_FILE_INVALID;
+       }
        
        result = reg_load_tree( regfile, krecord->name, rootkey );