fix for possible dounle fclose in makesrna's replace_if_different function.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 29 Jul 2013 08:01:12 +0000 (08:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 29 Jul 2013 08:01:12 +0000 (08:01 +0000)
source/blender/makesrna/intern/makesrna.c

index 0002fd3040b8398f3f3917a16a2fb91f1ce04356..f382caaccba0b883fde3552b10f46dccc48e79b8 100644 (file)
@@ -177,8 +177,8 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
 
 
        if (len_new != len_org) {
-               fclose(fp_new);
-               fclose(fp_org);
+               fclose(fp_new); fp_new = NULL;
+               fclose(fp_org); fp_org = NULL;
                REN_IF_DIFF;
        }
 
@@ -191,8 +191,8 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
        if (fread(arr_org, sizeof(char), len_org, fp_org) != len_org)
                fprintf(stderr, "%s:%d, error reading file %s for comparison.\n", __FILE__, __LINE__, orgfile);
 
-       fclose(fp_new);
-       fclose(fp_org);
+       fclose(fp_new); fp_new = NULL;
+       fclose(fp_org); fp_org = NULL;
 
        cmp = memcmp(arr_new, arr_org, len_new);