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://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=427e20b261b056cf781af75ff60f067714b750bb;p=systemd libudev: device - allocate envp array only once --- diff --git a/test/udev-test.pl b/test/udev-test.pl index 096977a6..95f9af0e 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;