From 5942e22d711566d20884ad86f364ee30dce5edd1 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 23 Jul 2008 22:18:06 +0000 Subject: [PATCH] Memory leaks. --- arg.c | 4 +++- tty-keys.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arg.c b/arg.c index 9ba299c9..d1bc06d6 100644 --- a/arg.c +++ b/arg.c @@ -1,4 +1,4 @@ -/* $Id: arg.c,v 1.3 2008-06-18 22:21:51 nicm Exp $ */ +/* $Id: arg.c,v 1.4 2008-07-23 22:18:06 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -115,6 +115,8 @@ arg_parse_session(const char *arg) xfree(arg2); return (c->session); } + + xfree(arg2); } return (NULL); diff --git a/tty-keys.c b/tty-keys.c index 5805e227..7197bce3 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -1,4 +1,4 @@ -/* $Id: tty-keys.c,v 1.5 2008-06-25 07:30:08 nicm Exp $ */ +/* $Id: tty-keys.c,v 1.6 2008-07-23 22:18:06 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -253,8 +253,10 @@ tty_keys_find(struct tty *tty, char *buf, size_t len, size_t *size) tl.string = s; tk = RB_FIND(tty_keys, &tty->ktree, &tl); - if (tk != NULL) + if (tk != NULL) { + xfree(s); return (tk); + } } xfree(s);