From 1a13f39cf6a48fc8787f6e117cf06dcdedc702e0 Mon Sep 17 00:00:00 2001 From: squishyhuman Date: Thu, 19 Jan 2017 11:26:57 -0800 Subject: [PATCH] Fix use of uninitialized variable --- dnslink/dnslink.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dnslink/dnslink.c b/dnslink/dnslink.c index 1ced40a..06f451d 100644 --- a/dnslink/dnslink.c +++ b/dnslink/dnslink.c @@ -144,6 +144,7 @@ int ipfs_dns (int argc, char **argv) free (*txt); free (txt); free (param); + param = path; if (! r) { // not recursive. @@ -153,11 +154,9 @@ int ipfs_dns (int argc, char **argv) if (memcmp(path, "/ipfs/", 6) == 0) { break; } - - param = path; } while (--r); - fprintf (stdout, "%s\n", path); - free (path); + fprintf (stdout, "%s\n", param); + free (param); return 0; }