[libvirt] [PATCH v3 20/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/secret/*

Michal Privoznik mprivozn at redhat.com
Fri May 3 14:53:25 UTC 2013


---
 src/secret/secret_driver.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 377b9f4..5d1739f 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -1097,9 +1097,8 @@ secretStateInitialize(bool privileged,
     secretDriverLock(driverState);
 
     if (privileged) {
-        base = strdup(SYSCONFDIR "/libvirt");
-        if (base == NULL)
-            goto out_of_memory;
+        if (VIR_STRDUP(base, SYSCONFDIR "/libvirt") < 0)
+            goto error;
     } else {
         base = virGetUserConfigDirectory();
         if (!base)
-- 
1.8.1.5




More information about the libvir-list mailing list