瀏覽代碼

Fix null pointer dereference in text lookup

Fix potential null pointer dereference for when splitting a node.
jp9000 11 年之前
父節點
當前提交
44066f8e61
共有 1 個文件被更改,包括 5 次插入3 次删除
  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)
 {
-	bfree(leaf->lookup);
-	bfree(leaf->value);
-	bfree(leaf);
+	if (leaf) {
+		bfree(leaf->lookup);
+		bfree(leaf->value);
+		bfree(leaf);
+	}
 }
 
 /* ------------------------------------------------------------------------- */