obj_context_set_machine_name calls obj_list_get_obj,
but does not call obj_list_put in calloc err path.

Signed-off-by: Jerry Snitselaar <[email protected]>
---
 src/tspi/obj_context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tspi/obj_context.c b/src/tspi/obj_context.c
index 5db6d8c..cc2090d 100644
--- a/src/tspi/obj_context.c
+++ b/src/tspi/obj_context.c
@@ -276,6 +276,7 @@ obj_context_set_machine_name(TSS_HCONTEXT tspContext, BYTE 
*name, UINT32 len)
     context->machineName = (BYTE *)calloc(1, len);
     if (context->machineName == NULL) {
         LogError("malloc of %u bytes failed.", len);
+       obj_list_put(&context_list);
         return TSPERR(TSS_E_OUTOFMEMORY);
     }
     memcpy(context->machineName, name, len);
-- 
2.12.2.430.ge0ef7fe78


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to