Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2020-04-23 10:01:26 +01:00
commit e94a15b3d6
2 changed files with 9 additions and 2 deletions

View File

@ -243,8 +243,12 @@ cmdq_copy_state(struct cmdq_state *state)
void void
cmdq_free_state(struct cmdq_state *state) cmdq_free_state(struct cmdq_state *state)
{ {
if (--state->references == 0) if (--state->references != 0)
free(state); return;
if (state->formats != NULL)
format_free(state->formats);
free(state);
} }
/* Add a format to command queue. */ /* Add a format to command queue. */

View File

@ -364,6 +364,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
window_remove_pane(w, new_wp); window_remove_pane(w, new_wp);
} }
sigprocmask(SIG_SETMASK, &oldset, NULL); sigprocmask(SIG_SETMASK, &oldset, NULL);
environ_free(child);
return (NULL); return (NULL);
} }
@ -450,6 +451,8 @@ complete:
sigprocmask(SIG_SETMASK, &oldset, NULL); sigprocmask(SIG_SETMASK, &oldset, NULL);
window_pane_set_event(new_wp); window_pane_set_event(new_wp);
environ_free(child);
if (sc->flags & SPAWN_RESPAWN) if (sc->flags & SPAWN_RESPAWN)
return (new_wp); return (new_wp);
if ((~sc->flags & SPAWN_DETACHED) || w->active == NULL) { if ((~sc->flags & SPAWN_DETACHED) || w->active == NULL) {