diff --git a/common.c b/common.c index 3d570d0..2f008d5 100644 --- a/common.c +++ b/common.c @@ -487,9 +487,11 @@ void setup_signals(void) * banner is made up of basename(bin_name)+"[pid]" */ void setup_syslog(const char* bin_name) { char *name1, *name2; + int res; name1 = strdup(bin_name); - asprintf(&name2, "%s[%d]", basename(name1), getpid()); + res = asprintf(&name2, "%s[%d]", basename(name1), getpid()); + CHECK_RES_DIE(res, "asprintf"); openlog(name2, LOG_CONS, LOG_AUTH); free(name1); /* Don't free name2, as openlog(3) uses it (at least in glibc) */ diff --git a/probe.c b/probe.c index d693797..fa34f96 100644 --- a/probe.c +++ b/probe.c @@ -63,7 +63,8 @@ int get_num_builtins(void) { /* Sets the protocol name to connect to in case of timeout */ void set_ontimeout(const char* name) { - asprintf(&on_timeout, "%s", name); + int res = asprintf(&on_timeout, "%s", name); + CHECK_RES_DIE(res, "asprintf"); } /* Returns the protocol to connect to in case of timeout; diff --git a/sslh-main.c b/sslh-main.c index a3b8352..a522b1a 100644 --- a/sslh-main.c +++ b/sslh-main.c @@ -79,11 +79,14 @@ static void print_usage(void) { struct proto *p; int i; + int res; char *prots = ""; p = get_builtins(); - for (i = 0; i < get_num_builtins(); i++) - asprintf(&prots, "%s\t[--%s ]\n", prots, p[i].description); + for (i = 0; i < get_num_builtins(); i++) { + res = asprintf(&prots, "%s\t[--%s ]\n", prots, p[i].description); + CHECK_RES_DIE(res, "asprintf"); + } fprintf(stderr, USAGE_STRING, prots); }