free(NULL) is already a nop.

(Based on Dag's remark during a review on some other code)

-- 
Guillaume Quintard
From 5830d189014d2625212ddc7b39b3d0c494d41c3e Mon Sep 17 00:00:00 2001
From: Guillaume Quintard <[email protected]>
Date: Mon, 26 Oct 2015 10:59:05 +0100
Subject: [PATCH] Remove unnecessary check

---
 include/miniobj.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/miniobj.h b/include/miniobj.h
index 3de4091..8b4f043 100644
--- a/include/miniobj.h
+++ b/include/miniobj.h
@@ -61,8 +61,7 @@
 
 #define REPLACE(ptr, val)						\
 	do {								\
-		if ((ptr) != NULL)					\
-			free(ptr);					\
+		free(ptr);						\
 		if ((val) != NULL) {					\
 			ptr = strdup(val);				\
 			AN((ptr));					\
-- 
2.6.2

_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to