diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-04-23 09:26:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-04-23 09:26:39 -0400 |
commit | f5fa6ac534d9262701382cab3152826cc56a9e5d (patch) | |
tree | ff689d187f55f9de6ded04379eec4932412720ac /src/or/control.c | |
parent | 43a8457b56ce4cf185822e0f700deab5059b9d47 (diff) | |
download | tor-f5fa6ac534d9262701382cab3152826cc56a9e5d.tar.gz tor-f5fa6ac534d9262701382cab3152826cc56a9e5d.zip |
Avoid memory leak in error messages in control.c (not in any tor)
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/or/control.c b/src/or/control.c index bbc4115d10..547145bbe9 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1716,13 +1716,11 @@ getinfo_helper_dir(control_connection_t *control_conn, SMARTLIST_FOREACH(sl, char *, c, tor_free(c)); smartlist_free(sl); } else if (!strcmpstart(question, "hs/client/desc/id/")) { - char *msg; rend_cache_entry_t *e = NULL; question += strlen("hs/client/desc/id/"); if (strlen(question) != REND_SERVICE_ID_LEN_BASE32) { - tor_asprintf(&msg, "\"%s\" invalid address.", question); - *errmsg = msg; + *errmsg = "Invalid address"; return -1; } @@ -1730,8 +1728,7 @@ getinfo_helper_dir(control_connection_t *control_conn, /* Descriptor found in cache */ *answer = tor_strdup(e->desc); } else { - tor_asprintf(&msg, "\"%s\" not found in cache.", question); - *errmsg = msg; + *errmsg = "Not found in cache"; return -1; } } else if (!strcmpstart(question, "md/id/")) { |