fix: double free and double openEditor

I hadn't pulled latest change to main before my last branch-checkout.
There was some old code mixed with new one. Specially, the "note return"
button introduced in last version displaced the openEditor and some
free() inside a loop. That caused duplication of this part of the code.
I should be carefull next time to work on up-to-date branches.
This commit is contained in:
tomasr committed 2026-08-16 08:19:53 +02:00
1 parent edc979dccb
commit 449a9eaca6
1 file changed
+1 -2
+1 -2
View File
@@ -766,7 +766,7 @@ backup_config_end:
openEditor(fullPath, editorToOpen, shouldRender, shouldJumpToEnd, shouldDebug);
free(fullPath);
}
openEditor(fullPath, editorToOpen, shouldRender, shouldJumpToEnd, shouldDebug);
free(returnNoteSelection);
if (gitEnabled) { // After closing a file, we need to update the git repo (if git is enable
char *date = getDateAndTime();
char *commitMsg = malloc(29);
@@ -775,7 +775,6 @@ backup_config_end:
free(date);
free(commitMsg);
}
free(fullPath);
} else if (strcmp(noteSelected, "Create new note") == 0) {
note_creation:
noteSelected = createNewNote(notesDirectoryString, vaultSelected, bypassSelectionNote, bypassSelectionNoteValue, journalRegex, shouldDebug);