[torsocks/master] Fix: check strdup return value in config-file.c

commit 12460511b2f900f5a1b5cde891dc97e1bfa3167d Author: David Goulet <dgoulet@ev0ke.net> Date: Thu Feb 20 15:41:04 2014 +0000 Fix: check strdup return value in config-file.c Signed-off-by: David Goulet <dgoulet@ev0ke.net> --- src/common/config-file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/config-file.c b/src/common/config-file.c index 39ca792..61a0f90 100644 --- a/src/common/config-file.c +++ b/src/common/config-file.c @@ -152,6 +152,10 @@ static int set_tor_address(const char *addr, struct configuration *config) config->conf_file.tor_domain = CONNECTION_DOMAIN_INET6; } config->conf_file.tor_address = strdup(addr); + if (!config->conf_file.tor_address) { + ret = -ENOMEM; + goto error; + } DBG("Config file setting tor address to %s", addr); ret = 0;
participants (1)
-
dgoulet@torproject.org