소스 검색

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);
+	}
 }
 
 /* ------------------------------------------------------------------------- */