mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
Fix possible free(NULL) in control.c
svn:r5306
This commit is contained in:
parent
26caf69555
commit
91a666064a
@ -847,10 +847,14 @@ handle_control_getconf(connection_t *conn, uint32_t body_len, const char *body)
|
|||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (answers) SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp));
|
if (answers) {
|
||||||
if (questions) SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp));
|
SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp));
|
||||||
smartlist_free(answers);
|
smartlist_free(answers);
|
||||||
smartlist_free(questions);
|
}
|
||||||
|
if (questions) {
|
||||||
|
SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp));
|
||||||
|
smartlist_free(questions);
|
||||||
|
}
|
||||||
smartlist_free(unrecognized);
|
smartlist_free(unrecognized);
|
||||||
tor_free(msg);
|
tor_free(msg);
|
||||||
|
|
||||||
@ -1472,10 +1476,14 @@ handle_control_getinfo(connection_t *conn, uint32_t len, const char *body)
|
|||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (answers) SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp));
|
if (answers) {
|
||||||
if (questions) SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp));
|
SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp));
|
||||||
smartlist_free(answers);
|
smartlist_free(answers);
|
||||||
smartlist_free(questions);
|
}
|
||||||
|
if (questions) {
|
||||||
|
SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp));
|
||||||
|
smartlist_free(questions);
|
||||||
|
}
|
||||||
smartlist_free(unrecognized);
|
smartlist_free(unrecognized);
|
||||||
tor_free(msg);
|
tor_free(msg);
|
||||||
|
|
||||||
@ -2483,7 +2491,7 @@ enable_control_logging(void)
|
|||||||
|
|
||||||
/** We got a log message: tell any interested control connections. */
|
/** We got a log message: tell any interested control connections. */
|
||||||
void
|
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;
|
int oldlog, event;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user