diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-10-25 07:02:13 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-10-25 07:02:13 +0000 |
commit | 91a666064ab58df284cfa180251e2abf3d9e3481 (patch) | |
tree | 9aa74e4dfcbc6fe35accf5b7563a7634dd0ab1b7 /src | |
parent | 26caf69555fcd359005e5e87d4a0a32ff210078a (diff) | |
download | tor-91a666064ab58df284cfa180251e2abf3d9e3481.tar.gz tor-91a666064ab58df284cfa180251e2abf3d9e3481.zip |
Fix possible free(NULL) in control.c
svn:r5306
Diffstat (limited to 'src')
-rw-r--r-- | src/or/control.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/or/control.c b/src/or/control.c index 4e9206866e..a2d8079d9a 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -847,10 +847,14 @@ handle_control_getconf(connection_t *conn, uint32_t body_len, const char *body) } done: - if (answers) SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp)); - if (questions) SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp)); - smartlist_free(answers); - smartlist_free(questions); + if (answers) { + SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp)); + smartlist_free(answers); + } + if (questions) { + SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp)); + smartlist_free(questions); + } smartlist_free(unrecognized); tor_free(msg); @@ -1472,10 +1476,14 @@ handle_control_getinfo(connection_t *conn, uint32_t len, const char *body) } done: - if (answers) SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp)); - if (questions) SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp)); - smartlist_free(answers); - smartlist_free(questions); + if (answers) { + SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp)); + smartlist_free(answers); + } + if (questions) { + SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp)); + smartlist_free(questions); + } smartlist_free(unrecognized); tor_free(msg); @@ -2483,7 +2491,7 @@ enable_control_logging(void) /** We got a log message: tell any interested control connections. */ void -control_event_logmsg(int severity, int domain, const char *msg) +control_event_logmsg(int severity, unsigned int domain, const char *msg) { int oldlog, event; |