remember to malloc space for the defaultPaths too

This commit is contained in:
iceman1001
2023-07-10 01:44:34 +02:00
parent 3f157d63d8
commit 17be2f6c3e
+1 -1
View File
@@ -200,7 +200,7 @@ char *newfilenamemcopyEx(const char *preferredName, const char *suffix, savePath
// 1: null terminator
// 16: room for filenum to ensure new filename
// save_path_len + strlen(PATHSEP): the user preference save paths
const size_t len = p_namelen + strlen(suffix) + 1 + 16 + save_path_len + strlen(PATHSEP);
const size_t len = p_namelen + strlen(suffix) + 1 + 16 + save_path_len + strlen(PATHSEP) + strlen(g_session.defaultPaths[e_save_path]);
char *fileName = (char *) calloc(len, sizeof(uint8_t));
if (fileName == NULL) {