From a79bc3ecfdd28ad12b9e5363a83b3ff5014872ac Mon Sep 17 00:00:00 2001 From: defanor Date: Fri, 5 May 2017 22:15:15 +0300 Subject: Compare opt.peer_cert_path to NULL, not 0 --- configure.ac | 2 +- tlsd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 9306649..23544c5 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT(TLSd, 0.0.5, defanor@uberspace.net, tlsd, +AC_INIT(TLSd, 0.0.6, defanor@uberspace.net, tlsd, https://defanor.uberspace.net/projects/tlsd/) AM_INIT_AUTOMAKE([-Wall]) AC_CONFIG_SRCDIR([tlsd.c]) diff --git a/tlsd.c b/tlsd.c index 5462741..db14bbf 100644 --- a/tlsd.c +++ b/tlsd.c @@ -798,7 +798,7 @@ int main (int argc, /* TODO: consider using chdir or open/openat instead */ opt.peer_cert_path = malloc(opt.peer_cert_dir_len + MAX_FINGERPRINT_NIBBLES + 1); - if (! opt.peer_cert_path) { + if (opt.peer_cert_path == NULL) { syslog(LOG_ERR, "Failed to allocate memory"); closelog(); return 1; @@ -810,7 +810,7 @@ int main (int argc, ret = serve(opt); /* Cleanup and exit */ - if (opt.peer_cert_path) + if (opt.peer_cert_path != NULL) free(opt.peer_cert_path); closelog(); return ret; -- cgit v1.2.3