aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Zitzmann <nickzman@gmail.com>2013-02-19 19:03:39 -0700
committerNick Zitzmann <nickzman@gmail.com>2013-02-19 19:03:39 -0700
commit80e2b3edb9755ff915185b4fbfa285d482c6bfc6 (patch)
tree6d9ca7c15e6a1dc6f2f8002b948ed82d7f43defe
parent52605e006cddccf8b7194389f7e14c04bee089c3 (diff)
metalink: fix improbable crash parsing metalink filename
The this_url pointer wasn't being initialized, so if strdup() would return null when copying the filename in a metalink file, then hilarity would ensue during the cleanup phase. This change was brought to you by clang, which noticed this and raised a warning.
-rw-r--r--src/tool_operate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 4166fc2ef..5e73d86d4 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -535,7 +535,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
long retry_numretries;
long retry_sleep_default;
long retry_sleep;
- char *this_url;
+ char *this_url = NULL;
int metalink_next_res = 0;
outfile = NULL;