diff options
author | 2017-02-15 23:38:31 +0000 | |
---|---|---|
committer | 2017-02-15 23:38:31 +0000 | |
commit | 7b5100f019fa1155c81f4a724ec7e7ef3115d5a8 (patch) | |
tree | 9d57eb10ca400ec3a85388b6e778b8a3c0645cf6 | |
parent | whitespace fixes (diff) | |
download | wireguard-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.c | 7 |
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'; |