summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-22 12:23:23 +0100
committersin <sin@2f30.org>2014-09-22 12:23:23 +0100
commit1a43beddb893b9198103a42aac3e8773f1af3cef (patch)
treecade232122e7008294971a4dada8ac3dfd3ac97a
parentc172129d1e28cf27ccb5d30f0648a73a726dc94e (diff)
Just realloc(), don't leak if we get called more than once
-rw-r--r--ratox.c2
1 files changed, 1 insertions, 1 deletions
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);