1
0
Эх сурвалжийг харах

Fix null pointer dereference in text lookup

Fix potential null pointer dereference for when splitting a node.
jp9000 11 жил өмнө
parent
commit
44066f8e61

+ 5 - 3
libobs/util/text-lookup.c

@@ -27,9 +27,11 @@ struct text_leaf {
 
 static inline void text_leaf_destroy(struct text_leaf *leaf)
 {
-	bfree(leaf->lookup);
-	bfree(leaf->value);
-	bfree(leaf);
+	if (leaf) {
+		bfree(leaf->lookup);
+		bfree(leaf->value);
+		bfree(leaf);
+	}
 }
 
 /* ------------------------------------------------------------------------- */