From 427e20b261b056cf781af75ff60f067714b750bb Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 26 Oct 2008 14:31:46 +0100 Subject: libudev: device - allocate envp array only once --- test/udev-test.pl | 3 ++- udev/lib/libudev-device.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/udev-test.pl b/test/udev-test.pl index 096977a611..95f9af0e2b 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1663,10 +1663,11 @@ EOF exp_name => "sda-8741C4G-end", exp_perms => "0:0:0660", rules => <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; -- cgit v1.2.3-54-g00ecf