chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libudev: device - allocate envp array only once
[elogind.git]
/
udev
/
lib
/
libudev-device.c
diff --git
a/udev/lib/libudev-device.c
b/udev/lib/libudev-device.c
index bad6e94de58f462a0e6fac888442f3e2b68eca69..11a6037d1b823006fd117568ff50037a846cd530 100644
(file)
--- a/
udev/lib/libudev-device.c
+++ b/
udev/lib/libudev-device.c
@@
-1025,8
+1025,8
@@
static int update_envp_monitor_buf(struct udev_device *udev_device)
return -ENOMEM;
/* envp array, strings will point into monitor buffer */
return -ENOMEM;
/* envp array, strings will point into monitor buffer */
- free(udev_device->envp);
- udev_device->envp = malloc(sizeof(char *) * ENVP_SIZE);
+ if (udev_device->envp == NULL)
+
udev_device->envp = malloc(sizeof(char *) * ENVP_SIZE);
if (udev_device->envp == NULL)
return -ENOMEM;
if (udev_device->envp == NULL)
return -ENOMEM;