Avoid freeing fsp twice when opening new_file fails. (Debian #431696)
authorJelmer Vernooij <jelmer@samba.org>
Mon, 29 Sep 2008 17:53:36 +0000 (10:53 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 29 Sep 2008 17:53:36 +0000 (10:53 -0700)
If opening new_file fails, fsp would still be set to the files_struct of
old_file.

source/printing/nt_printing.c

index a66b1e5c5f621ad89cbb29f0c33cbce86bca67b7..2c3769330591f3cd9c2d43bdd6327c9834190af7 100644 (file)
@@ -1379,6 +1379,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
                }
        }
        close_file(fsp, NORMAL_CLOSE);
+       fsp = NULL;
 
        /* Get file version info (if available) for new file */
        filepath = driver_unix_convert(conn,new_file,&stat_buf);