]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmddata.c
CHG: added a check if err variable is NIL.
[proxmark3-svn] / client / cmddata.c
index f263bbe9ef4a52f1edb650de13b085abb5166c28..169b0acebd7194644a5a7682b115ed4c0ef4d5b0 100644 (file)
@@ -2216,7 +2216,10 @@ int CmdLoad(const char *Cmd)
                GraphBuffer[GraphTraceLen] = atoi(line);
                GraphTraceLen++;
        }
-       fclose(f);
+       if (f) {
+               fclose(f);
+               f = NULL;
+       }
        PrintAndLog("loaded %d samples", GraphTraceLen);
        RepaintGraphWindow();
        return 0;
@@ -2290,7 +2293,10 @@ int CmdSave(const char *Cmd)
        for (i = 0; i < GraphTraceLen; i++) {
                fprintf(f, "%d\n", GraphBuffer[i]);
        }
-       fclose(f);
+       if (f) {
+               fclose(f);
+               f = NULL;
+       }
        PrintAndLog("saved to '%s'", Cmd);
        return 0;
 }
Impressum, Datenschutz