summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-06-05 14:20:55 +0100
committerRoy Marples <roy@marples.name>2020-06-05 14:20:55 +0100
commit2fb5f79deb21d5029700061386101497282c115d (patch)
tree5ff3836ead9b81e96ec8cfbfef1660c57989a3a4 /src/if.c
parent59c952ac3db05d7ec0a8c275b3163fde32a7fade (diff)
downloaddhcpcd-2fb5f79deb21d5029700061386101497282c115d.tar.xz
privsep: Only use freeifaddrs if not using privsep
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/if.c b/src/if.c
index 7ca538af..fca65c3f 100644
--- a/src/if.c
+++ b/src/if.c
@@ -337,7 +337,12 @@ if_learnaddrs(struct dhcpcd_ctx *ctx, struct if_head *ifs,
}
}
- freeifaddrs(*ifaddrs);
+#ifdef PRIVSEP_GETIFADDRS
+ if (IN_PRIVSEP(ctx))
+ free(*ifaddrs);
+ else
+#endif
+ freeifaddrs(*ifaddrs);
*ifaddrs = NULL;
}