[pacman-dev] [PATCH 1/4] pacsort: fix memory leak

Allan McRae allan at archlinux.org
Wed Dec 24 02:14:00 UTC 2014


Signed-off-by: Allan McRae <allan at archlinux.org>
---
 src/util/pacsort.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/pacsort.c b/src/util/pacsort.c
index 665f218..c59ba13 100644
--- a/src/util/pacsort.c
+++ b/src/util/pacsort.c
@@ -227,6 +227,7 @@ static struct input_t *input_new(const char *path, int pathlen)
 
 	in->data = strndup(path, pathlen);
 	if(in->data == NULL) {
+		free(in);
 		return NULL;
 	}
 
-- 
2.2.1


More information about the pacman-dev mailing list