~emersion/mrsh

f5a0db4e910db6c961413e8a60131dd18372affe — Drew DeVault 6 years ago 4da12aa
Avoid null dereference in argv_free
1 files changed, 3 insertions(+), 0 deletions(-)

M builtin/set.c
M builtin/set.c => builtin/set.c +3 -0
@@ 74,6 74,9 @@ static char **argv_dup(char *argv_0, int argc, char *argv[]) {
}

static void argv_free(int argc, char **argv) {
	if (!argv) {
		return;
	}
	for (int i = 0; i < argc; ++i) {
		free(argv[i]);
	}