Fix Coverity IDs 451, 452
authorVolker Lendecke <vl@samba.org>
Fri, 25 Jan 2008 10:13:19 +0000 (11:13 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 25 Jan 2008 19:55:51 +0000 (20:55 +0100)
(This used to be commit d28a537277bedb65d1c2a01c971a3a22b1aa6624)

source3/registry/regfio.c

index 92077aa84788c40519870610f2acc27f6294ae6a..3740ff0ee4a5d8e956fd891b6f71aa92144a2a7f 100644 (file)
@@ -1234,7 +1234,7 @@ static void regfio_mem_free( REGF_FILE *file )
 
        /* cleanup for a file opened for write */
 
-       if ( file->open_flags & (O_WRONLY|O_RDWR) ) {
+       if ((file->fd != -1) && (file->open_flags & (O_WRONLY|O_RDWR))) {
                prs_struct ps;
                REGF_SK_REC *sk;