Merge pull request #5 from squishyhuman/fix-uninitialized-var

Fix use of uninitialized variable
This commit is contained in:
Jose Marcial Vieira Bisneto 2017-01-20 08:17:33 -03:00 committed by GitHub
commit 3e39fec066

View file

@ -128,6 +128,8 @@ int ipfs_dns (int argc, char **argv)
} else {
err = ipfs_dnslink_resolv_lookupTXT (&txt, param);
}
free (param);
if (err) {
fprintf (stderr, "dns lookupTXT: %s\n", Err[err]);
return err;
@ -143,7 +145,7 @@ int ipfs_dns (int argc, char **argv)
free (*txt);
free (txt);
free (param);
param = path;
if (! r) {
// not recursive.
@ -153,11 +155,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;
}