changeset 5517:86d8640d181a draft dhcpcd-9.3.1

duid: plug a potential memory leak
author Roy Marples <roy@marples.name>
date Mon, 12 Oct 2020 14:56:34 +0100
parents 22b88499388a
children edeb84f3f081
files src/duid.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/duid.c	Mon Oct 12 14:41:06 2020 +0100
+++ b/src/duid.c	Mon Oct 12 14:56:34 2020 +0100
@@ -178,8 +178,9 @@
 	if (ifp == NULL) {
 		if (ctx->duid_type != DUID_DEFAULT &&
 		    ctx->duid_type != DUID_UUID)
-			return 0;
-		len = duid_make_uuid(data);
+			len = 0;
+		else
+			len = duid_make_uuid(data);
 		if (len == 0)
 			free(data);
 		else