Merge (#65) from tomasriveral/fix-double-free

fix: double free and double openEditor
This commit is contained in:
tomasr authored and GitHub committed 2026-08-16 08:38:07 +02:00
commit d56e7d9e4f
1 file changed
+1 -2
+1 -2
View File
@@ -766,7 +766,7 @@ backup_config_end:
openEditor(fullPath, editorToOpen, shouldRender, shouldJumpToEnd, shouldDebug); openEditor(fullPath, editorToOpen, shouldRender, shouldJumpToEnd, shouldDebug);
free(fullPath); 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 if (gitEnabled) { // After closing a file, we need to update the git repo (if git is enable
char *date = getDateAndTime(); char *date = getDateAndTime();
char *commitMsg = malloc(29); char *commitMsg = malloc(29);
@@ -775,7 +775,6 @@ backup_config_end:
free(date); free(date);
free(commitMsg); free(commitMsg);
} }
free(fullPath);
} else if (strcmp(noteSelected, "Create new note") == 0) { } else if (strcmp(noteSelected, "Create new note") == 0) {
note_creation: note_creation:
noteSelected = createNewNote(notesDirectoryString, vaultSelected, bypassSelectionNote, bypassSelectionNoteValue, journalRegex, shouldDebug); noteSelected = createNewNote(notesDirectoryString, vaultSelected, bypassSelectionNote, bypassSelectionNoteValue, journalRegex, shouldDebug);