diff --git a/client/src/preferences.c b/client/src/preferences.c index 1e0b59297..9d482a1f5 100644 --- a/client/src/preferences.c +++ b/client/src/preferences.c @@ -122,6 +122,7 @@ int preferences_save(void) { char* backupFilename = (char *)calloc(fnLen, sizeof(uint8_t)); if (backupFilename == NULL) { PrintAndLogEx(ERR, "failed to allocate memory"); + free(fn); return PM3_EMALLOC; } snprintf(backupFilename, fnLen, "%s.bak", fn);