summaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-09-05 20:52:15 +0000
committerNick Mathewson <nickm@torproject.org>2008-09-05 20:52:15 +0000
commit0b8117a5c002b262b6ee56acc3719700637416c7 (patch)
tree73746b443d10620630933d7de5d0f467378fb5d7 /src/or/rendclient.c
parent4d94e061c7a1af2fbb92ab3114c3ce5f59971a31 (diff)
downloadtor-0b8117a5c002b262b6ee56acc3719700637416c7.tar.gz
tor-0b8117a5c002b262b6ee56acc3719700637416c7.zip
Fix numerous memory leaks: some were almost impossible to trigger, and some almost inevitable.
svn:r16779
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 24889bbb5f..a1c1eb07ab 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -764,13 +764,14 @@ rend_parse_service_authorization(or_options_t *options, int validate_only)
int res = -1;
strmap_t *parsed = strmap_new();
smartlist_t *sl = smartlist_create();
+ rend_service_authorization_t *auth = NULL;
for (line = options->HidServAuth; line; line = line->next) {
char *onion_address, *descriptor_cookie;
char descriptor_cookie_tmp[REND_DESC_COOKIE_LEN+2];
char descriptor_cookie_base64ext[REND_DESC_COOKIE_LEN_BASE64+2+1];
- rend_service_authorization_t *auth = NULL;
int auth_type_val = 0;
+ auth = NULL;
SMARTLIST_FOREACH(sl, char *, c, tor_free(c););
smartlist_clear(sl);
smartlist_split_string(sl, line->value, " ",
@@ -829,12 +830,15 @@ rend_parse_service_authorization(or_options_t *options, int validate_only)
goto err;
}
strmap_set(parsed, auth->onion_address, auth);
+ auth = NULL;
}
res = 0;
goto done;
err:
res = -1;
done:
+ if (auth)
+ rend_service_authorization_free(auth);
SMARTLIST_FOREACH(sl, char *, c, tor_free(c););
smartlist_free(sl);
if (!validate_only && res == 0) {