summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-01 10:16:42 +0200
committerTom Gundersen <teg@jklm.no>2014-07-01 10:21:18 +0200
commit54d61deb7bffec5ca22cf765b13afbb0af547868 (patch)
tree6267e008e7667e971ad99a33d38ba86588e73161
parent5da8149fd33f07aabdac72880143ec13e516f933 (diff)
sd-dhcp6-client: fix free before use
-rw-r--r--src/libsystemd-network/sd-dhcp6-client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index 2d5bedcb8b..6e006624ca 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -532,6 +532,9 @@ error:
}
static int client_ensure_iaid(sd_dhcp6_client *client) {
+ /* name is a pointer to memory in the udev_device struct, so must
+ have the same scope */
+ _cleanup_udev_device_unref_ struct udev_device *device = NULL;
const char *name = NULL;
uint64_t id;
@@ -543,7 +546,6 @@ static int client_ensure_iaid(sd_dhcp6_client *client) {
if (detect_container(NULL) <= 0) {
/* not in a container, udev will be around */
_cleanup_udev_unref_ struct udev *udev;
- _cleanup_udev_device_unref_ struct udev_device *device = NULL;
char ifindex_str[2 + DECIMAL_STR_MAX(int)];
udev = udev_new();