From: Kay Sievers Date: Sun, 26 Oct 2008 13:31:46 +0000 (+0100) Subject: libudev: device - allocate envp array only once X-Git-Tag: 174~1371 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=427e20b261b056cf781af75ff60f067714b750bb libudev: device - allocate envp array only once --- diff --git a/test/udev-test.pl b/test/udev-test.pl index 096977a61..95f9af0e2 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;