patch-p11-kit_modules_c 920 B

1234567891011121314151617181920212223242526272829
  1. $OpenBSD: patch-p11-kit_modules_c,v 1.1 2016/03/06 12:16:26 ajacoutot Exp $
  2. From 6c4ef3f492d88acca931174519b7aa1215cc1a18 Mon Sep 17 00:00:00 2001
  3. From: Pankaj <pankaj.s01@samsung.com>
  4. Date: Tue, 5 Jan 2016 09:52:00 +0000
  5. Subject: Avoiding redundant check
  6. --- p11-kit/modules.c.orig Wed Oct 21 08:20:53 2015
  7. +++ p11-kit/modules.c Sat Mar 5 09:57:47 2016
  8. @@ -2326,17 +2326,15 @@ p11_module_load_inlock_reentrant (CK_FUNCTION_LIST *mo
  9. }
  10. /* If this was newly allocated, add it to the list */
  11. - if (rv == CKR_OK && allocated) {
  12. + if (allocated) {
  13. if (!p11_dict_set (gl.modules, allocated, allocated) ||
  14. !p11_dict_set (gl.unmanaged_by_funcs, module, allocated))
  15. return_val_if_reached (CKR_HOST_MEMORY);
  16. allocated = NULL;
  17. }
  18. - if (rv == CKR_OK) {
  19. /* WARNING: Reentrancy can occur here */
  20. rv = prepare_module_inlock_reentrant (mod, flags, result);
  21. - }
  22. free (allocated);
  23. }