[libblockdev 02/10] Do not check for NULL value for ret

mulhern amulhern at redhat.com
Wed Jun 25 21:35:31 UTC 2014


If it is NULL, g_strdup will return NULL.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 src/plugins/crypto.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
index 45157ae..c00862e 100644
--- a/src/plugins/crypto.c
+++ b/src/plugins/crypto.c
@@ -112,9 +112,7 @@ gchar* bd_crypto_luks_uuid (gchar *device, gchar **error_message) {
         return NULL;
     }
 
-    ret = crypt_get_uuid (cd);
-    if (ret)
-        ret = g_strdup (ret);
+    ret = g_strdup (crypt_get_uuid (cd));
     crypt_free (cd);
 
     return ret;
-- 
1.9.3



More information about the anaconda-patches mailing list