Change
free(instance);
to
handle_put();
handle_destroy();

Also add a missing handle_put() in key_create()

This unfortunately doesn't fix Fabio's leak.

-Angus

Signed-off-by: Angus Salkeld <[email protected]>
---
 exec/objdb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/exec/objdb.c b/exec/objdb.c
index 3334460..9c5873e 100644
--- a/exec/objdb.c
+++ b/exec/objdb.c
@@ -635,6 +635,7 @@ static int object_key_create_typed(
 
        object_key_changed_notification(object_handle, key_name, key_len,
                                        value, value_len, OBJECT_KEY_CREATED);
+       hdb_handle_put (&object_instance_database, object_handle);
        objdb_rdunlock();
        return (0);
 
@@ -727,7 +728,8 @@ static int object_destroy (
 
        list_del(&instance->child_list);
        free(instance->object_name);
-       free(instance);
+       hdb_handle_put (&object_instance_database, object_handle);
+       hdb_handle_destroy (&object_instance_database, object_handle);
 
        objdb_rdunlock();
        return (res);
-- 
1.6.3.4

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to