Commit e7bdfebd authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

rcfile: don't leak a shortcut when something goes wrong [coverity scan]

parent 4bbbb185
Showing with 1 addition and 2 deletions
+1 -2
...@@ -479,7 +479,6 @@ void parse_binding(char *ptr, bool dobind) ...@@ -479,7 +479,6 @@ void parse_binding(char *ptr, bool dobind)
if (!menu) { if (!menu) {
rcfile_error(N_("Function '%s' does not exist in menu '%s'"), funcptr, menuptr); rcfile_error(N_("Function '%s' does not exist in menu '%s'"), funcptr, menuptr);
free(newsc);
goto free_copy; goto free_copy;
} }
...@@ -489,7 +488,6 @@ void parse_binding(char *ptr, bool dobind) ...@@ -489,7 +488,6 @@ void parse_binding(char *ptr, bool dobind)
/* Do not allow rebinding a frequent escape-sequence starter: Esc [. */ /* Do not allow rebinding a frequent escape-sequence starter: Esc [. */
if (newsc->meta && newsc->keycode == 91) { if (newsc->meta && newsc->keycode == 91) {
rcfile_error(N_("Sorry, keystroke \"%s\" may not be rebound"), newsc->keystr); rcfile_error(N_("Sorry, keystroke \"%s\" may not be rebound"), newsc->keystr);
free(newsc);
goto free_copy; goto free_copy;
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -525,6 +523,7 @@ void parse_binding(char *ptr, bool dobind) ...@@ -525,6 +523,7 @@ void parse_binding(char *ptr, bool dobind)
} }
free_copy: free_copy:
free(newsc);
free(keycopy); free(keycopy);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment