summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-10-12 14:56:34 +0100
committerRoy Marples <roy@marples.name>2020-10-12 14:56:34 +0100
commit40a08e98eee7c7458e67a2e30aba2b8b42b2aba2 (patch)
tree07980b305b7be989e8c4e53b6b5433ef2b3dabad
parentfadb847a8eba78e8d6db058ca5e5cb3087d32893 (diff)
downloaddhcpcd-40a08e98eee7c7458e67a2e30aba2b8b42b2aba2.tar.xz
duid: plug a potential memory leakdhcpcd-9.3.1
-rw-r--r--src/duid.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/duid.c b/src/duid.c
index ce9214fa..764c74a9 100644
--- a/src/duid.c
+++ b/src/duid.c
@@ -178,8 +178,9 @@ duid_get(struct dhcpcd_ctx *ctx, const struct interface *ifp)
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