[master] 96a320430 Try to quench the last two (insignificant) Coverity issues.

Poul-Henning Kamp phk at FreeBSD.org
Mon Aug 29 10:08:05 UTC 2022


commit 96a32043050a7fa5cc1b74d5d6e04cb9aa9b0a36
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 29 10:06:48 2022 +0000

    Try to quench the last two (insignificant) Coverity issues.

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index c09d0b46d..e9d280f52 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -133,6 +133,7 @@ cli_sock(const char *T_arg, const char *S_arg)
 			fprintf(stderr, "Cannot open \"%s\": %s\n",
 			    S_arg, strerror(errno));
 			closefd(&sock);
+			free(answer);
 			return (-1);
 		}
 		VCLI_AuthResponse(fd, answer, buf);
diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index c75c5d894..5aa84a117 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -209,9 +209,9 @@ EXP_Insert(struct worker *wrk, struct objcore *oc)
 		ObjSendEvent(wrk, oc, OEV_EXPIRE);
 		tmpoc = oc;
 		assert(oc->refcnt >= 2); /* Silence coverity */
-		(void)HSH_DerefObjCore(wrk, &tmpoc, 0);
-		AZ(tmpoc);
-		assert(oc->refcnt >= 1); /* Silence coverity */
+		(void)HSH_DerefObjCore(wrk, &oc, 0);
+		AZ(oc);
+		assert(tmpoc->refcnt >= 1); /* Silence coverity */
 	}
 }
 


More information about the varnish-commit mailing list