Browse Source

Fix null pointer dereference in text lookup

Fix potential null pointer dereference for when splitting a node.
jp9000 11 years ago
parent
commit
44066f8e61
1 changed files with 5 additions and 3 deletions
  1. 5 3
      libobs/util/text-lookup.c

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

@@ -27,9 +27,11 @@ struct text_leaf {
 
 
 static inline void text_leaf_destroy(struct text_leaf *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);
+	}
 }
 }
 
 
 /* ------------------------------------------------------------------------- */
 /* ------------------------------------------------------------------------- */