summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2017-02-15 23:38:31 +0000
committerjsg <jsg@openbsd.org>2017-02-15 23:38:31 +0000
commit7b5100f019fa1155c81f4a724ec7e7ef3115d5a8 (patch)
tree9d57eb10ca400ec3a85388b6e778b8a3c0645cf6
parentwhitespace fixes (diff)
downloadwireguard-openbsd-7b5100f019fa1155c81f4a724ec7e7ef3115d5a8.tar.xz
wireguard-openbsd-7b5100f019fa1155c81f4a724ec7e7ef3115d5a8.zip
Fix memory leaks in match_filter_list() error paths.
ok dtucker@ markus@
-rw-r--r--usr.bin/ssh/match.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/ssh/match.c b/usr.bin/ssh/match.c
index 1a9c5288881..b2399c62cf6 100644
--- a/usr.bin/ssh/match.c
+++ b/usr.bin/ssh/match.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: match.c,v 1.34 2017/02/03 23:01:19 djm Exp $ */
+/* $OpenBSD: match.c,v 1.35 2017/02/15 23:38:31 jsg Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -295,8 +295,11 @@ match_filter_list(const char *proposal, const char *filter)
char *orig_prop = strdup(proposal);
char *cp, *tmp;
- if (fix_prop == NULL || orig_prop == NULL)
+ if (fix_prop == NULL || orig_prop == NULL) {
+ free(orig_prop);
+ free(fix_prop);
return NULL;
+ }
tmp = orig_prop;
*fix_prop = '\0';