tweaks: free two strings as soon as they are no longer needed

master
Benno Schulenberg 2020-01-14 11:01:32 +01:00
parent e8d20a8e4b
commit 3e0bd533db
1 changed files with 2 additions and 2 deletions

View File

@ -308,6 +308,8 @@ int do_lockfile(const char *filename, bool ask_the_user)
snprintf(lockfilename, locknamesize, "%s/%s%s%s", dirname(namecopy),
locking_prefix, basename(secondcopy), locking_suffix);
free(secondcopy);
free(namecopy);
if (!ask_the_user && stat(lockfilename, &fileinfo) != -1)
warn_and_shortly_pause(_("Someone else is also editing this file"));
@ -385,8 +387,6 @@ int do_lockfile(const char *filename, bool ask_the_user)
retval = write_lockfile(lockfilename, filename, FALSE);
free_the_name:
free(namecopy);
free(secondcopy);
if (retval < 1)
free(lockfilename);