[master] 3684858 No check needed, free(NULL) is a nop

Guillaume Quintard guillaume at varnish-software.com
Mon Sep 26 11:45:05 CEST 2016


commit 3684858d9e7275326a02521d4895be368b70400b
Author: Guillaume Quintard <guillaume at varnish-software.com>
Date:   Mon Sep 26 11:43:20 2016 +0200

    No check needed, free(NULL) is a nop

diff --git a/lib/libvarnish/vcli_proto.c b/lib/libvarnish/vcli_proto.c
index 27e2104..7e52fb2 100644
--- a/lib/libvarnish/vcli_proto.c
+++ b/lib/libvarnish/vcli_proto.c
@@ -187,8 +187,7 @@ VCLI_ReadResult(int fd, unsigned *status, char **ptr, double tmo)
 		return (0);
 	} while(0);
 
-	if (p != NULL)
-		free(p);
+	free(p);
 	*status = CLIS_COMMS;
 	if (ptr != NULL)
 		*ptr = strdup(err);



More information about the varnish-commit mailing list