From 9e00b0cadc2f9d9423bd9f27b45162ed81a4b438 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 21 Nov 2013 14:38:32 +0100 Subject: [PATCH] free() filename before throwing the pointer away avoids a memory-leak pointed out by @crosser --- util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util.c b/util.c index 841a9ee..cf16bdd 100644 --- a/util.c +++ b/util.c @@ -220,6 +220,7 @@ get_user_challenge_file(YK_KEY *yk, const char *chalresp_path, const char *usern filename_malloced = 1; if (res < 0 || res > len) { /* Not enough space, strangely enough. */ + free(filename); filename = NULL; } }