Bug 93589 - avoid redundant NULL check for 'to_close'
Summary: avoid redundant NULL check for 'to_close'
Status: RESOLVED FIXED
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-05 10:29 UTC by Pankaj
Modified: 2016-12-13 14:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proxy patch (457 bytes, text/plain)
2016-01-05 10:29 UTC, Pankaj
Details

Description Pankaj 2016-01-05 10:29:12 UTC
Created attachment 120810 [details]
proxy patch

Hi,
there is already checked for NULL at line
p11-kit/proxy.c:641 after memory allocation .So doesn't required to check inside while loop.
the respective patch has been attached ,please review it.
========================================================
diff --git a/p11-kit/proxy.c b/p11-kit/proxy.c
index c554511..994f2f1 100644
--- a/p11-kit/proxy.c
+++ b/p11-kit/proxy.c
@@ -644,7 +644,7 @@ proxy_C_CloseAllSessions (CK_X_FUNCTION_LIST *self,
                                p11_dict_iterate (state->px->sessions, &iter);
                                count = 0;
                                while (p11_dict_next (&iter, NULL, (void**)&sess)) {
-                                       if (sess->wrap_slot == id && to_close)
+                                       if (sess->wrap_slot == id)
                                                to_close[count++] = sess->wrap_session;
                                }
                        }


-----------------------------------------------------
Thanks !
Pankaj Sharma


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.