Fix: Memory leaks on unknown hashtable type error handling
[lttng-tools.git] / src / common / hashtable / hashtable.c
index 263df46839d37af58e2efe66770f5e1833c90f0f..8c26ebe15b63d3a71f2efd40398e2781e5ddbb59 100644 (file)
@@ -105,6 +105,7 @@ struct lttng_ht *lttng_ht_new(unsigned long size, int type)
                break;
        default:
                ERR("Unknown lttng hashtable type %d", type);
+               lttng_ht_destroy(ht);
                goto error;
        }
 
@@ -184,7 +185,7 @@ void lttng_ht_node_free_ulong(struct lttng_ht_node_ulong *node)
 /*
  * Free lttng ht node uint64_t.
  */
-void lttng_ht_node_free_u64(struct lttng_ht_node_ulong *node)
+void lttng_ht_node_free_u64(struct lttng_ht_node_u64 *node)
 {
        assert(node);
        free(node);
This page took 0.027256 seconds and 5 git commands to generate.