فهرست منبع

libobs/util: Skip pointless free for null

jpark37 4 سال پیش
والد
کامیت
3c09074ed5
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      libobs/util/bmem.c

+ 3 - 2
libobs/util/bmem.c

@@ -129,9 +129,10 @@ void *brealloc(void *ptr, size_t size)
 
 
 void bfree(void *ptr)
 void bfree(void *ptr)
 {
 {
-	if (ptr)
+	if (ptr) {
 		os_atomic_dec_long(&num_allocs);
 		os_atomic_dec_long(&num_allocs);
-	alloc.free(ptr);
+		alloc.free(ptr);
+	}
 }
 }
 
 
 long bnum_allocs(void)
 long bnum_allocs(void)