[flac-dev] [PATCH 2/2] Fix safe_realloc_add_2op_() to free memory when reallocation fails

Miroslav Lichvar mlichvar at redhat.com
Fri Jul 20 10:36:08 UTC 2018


---
 include/share/alloc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/share/alloc.h b/include/share/alloc.h
index 914de9ba..63878db0 100644
--- a/include/share/alloc.h
+++ b/include/share/alloc.h
@@ -168,7 +168,7 @@ static inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2)
 		free(ptr);
 		return 0;
 	}
-	return realloc(ptr, size2);
+	return safe_realloc_(ptr, size2);
 }
 
 static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)
-- 
2.17.1



More information about the flac-dev mailing list