From 1a43beddb893b9198103a42aac3e8773f1af3cef Mon Sep 17 00:00:00 2001 From: sin Date: Mon, 22 Sep 2014 12:23:23 +0100 Subject: Just realloc(), don't leak if we get called more than once --- ratox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index bf2121e..bbff027 100644 --- a/ratox.c +++ b/ratox.c @@ -564,7 +564,7 @@ readpass(void) } if (p[0] == '\0') return -1; - passphrase = malloc(strlen(p)); /* not null-terminated */ + passphrase = realloc(passphrase, strlen(p)); /* not null-terminated */ if (!passphrase) { perror("malloc"); exit(EXIT_FAILURE); -- cgit v1.2.3