[master] be7d170 No need to assign NULL after VSB_destroy

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Feb 26 10:09:11 CET 2016


commit be7d170db031d538d07c1802453a5cfc8add13a5
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Feb 26 10:08:35 2016 +0100

    No need to assign NULL after VSB_destroy

diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index dcfa96c..6ba5eb1 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -537,9 +537,7 @@ vep_do_include(struct vep_state *vep, enum dowhat what)
 	}
 #undef R
 	VSB_printf(vep->vsb, "%c", 0);
-
 	VSB_destroy(&vep->include_src);
-	vep->include_src = NULL;
 }
 
 /*---------------------------------------------------------------------
@@ -887,7 +885,6 @@ VEP_Parse(struct vep_state *vep, const char *p, size_t l)
 				if (vep->attr_vsb != NULL) {
 					AZ(VSB_finish(vep->attr_vsb));
 					VSB_destroy(&vep->attr_vsb);
-					vep->attr_vsb = NULL;
 				}
 			} else if (p < e) {
 				vep->attr_delim = 0;
diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 55c3303..1673169 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -128,7 +128,6 @@ static void
 mgt_panic_clear(void)
 {
 	VSB_destroy(&child_panic);
-	child_panic = NULL;
 }
 
 void __match_proto__(cli_func_t)
diff --git a/bin/varnishtest/vtc_logexp.c b/bin/varnishtest/vtc_logexp.c
index c82b8e4..cca71c8 100644
--- a/bin/varnishtest/vtc_logexp.c
+++ b/bin/varnishtest/vtc_logexp.c
@@ -528,10 +528,8 @@ cmd_logexp(CMD_ARGS)
 				vtc_log(le->vl, 0, "Missing -v argument");
 				return;
 			}
-			if (le->n_arg != NULL) {
+			if (le->n_arg != NULL)
 				VSB_destroy(&le->n_arg);
-				le->n_arg = NULL;
-			}
 			vsb = VSB_new_auto();
 			AN(vsb);
 			AZ(VSB_printf(vsb, "%s/%s", tmpdir, av[1]));
diff --git a/lib/libvarnish/cli_serve.c b/lib/libvarnish/cli_serve.c
index 87e8b54..6e3e41f 100644
--- a/lib/libvarnish/cli_serve.c
+++ b/lib/libvarnish/cli_serve.c
@@ -453,7 +453,6 @@ cls_vlu(void *priv, const char *p)
 		free(cli->cmd);
 		cli->cmd = NULL;
 		VSB_destroy(&cfd->last_arg);
-		cfd->last_arg = NULL;
 		cfd->last_idx = 0;
 		return (i);
 	}
diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index 24feeee..2bd801c 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -161,7 +161,6 @@ VSL_ResetError(struct VSL_data *vsl)
 	if (vsl->diag == NULL)
 		return;
 	VSB_destroy(&vsl->diag);
-	vsl->diag = NULL;
 }
 
 static int
diff --git a/lib/libvarnishapi/vsm.c b/lib/libvarnishapi/vsm.c
index 92b636e..4f614d5 100644
--- a/lib/libvarnishapi/vsm.c
+++ b/lib/libvarnishapi/vsm.c
@@ -124,7 +124,6 @@ VSM_ResetError(struct VSM_data *vd)
 	if (vd->diag == NULL)
 		return;
 	VSB_destroy(&vd->diag);
-	vd->diag = NULL;
 }
 
 /*--------------------------------------------------------------------*/



More information about the varnish-commit mailing list