]> granicus.if.org Git - p11-kit/commitdiff
Avoiding redundant check
authorPankaj <pankaj.s01@samsung.com>
Tue, 5 Jan 2016 09:52:00 +0000 (09:52 +0000)
committerStef Walter <stefw@redhat.com>
Tue, 5 Jan 2016 09:54:57 +0000 (10:54 +0100)
https://bugs.freedesktop.org/show_bug.cgi?id=93587

p11-kit/modules.c

index acb3707c641ae1713a4dc4d72ded51a00d6cdafd..63baeb1904de8da94e9fbbc3cc06b218a4fa0c57 100644 (file)
@@ -2326,17 +2326,15 @@ p11_module_load_inlock_reentrant (CK_FUNCTION_LIST *module,
                }
 
                /* If this was newly allocated, add it to the list */
-               if (rv == CKR_OK && allocated) {
+               if (allocated) {
                        if (!p11_dict_set (gl.modules, allocated, allocated) ||
                            !p11_dict_set (gl.unmanaged_by_funcs, module, allocated))
                                return_val_if_reached (CKR_HOST_MEMORY);
                        allocated = NULL;
                }
 
-               if (rv == CKR_OK) {
                        /* WARNING: Reentrancy can occur here */
                        rv = prepare_module_inlock_reentrant (mod, flags, result);
-               }
 
                free (allocated);
        }