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

2018-07-20 Thread Miroslav Lichvar
--- 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 *pt

[flac-dev] [PATCH 1/2] Avoid double free in iconvert()

2018-07-20 Thread Miroslav Lichvar
When safe_realloc_add_2op_(utfbuf, ...) is called with an invalid size and returns 0, set utfbuf to 0 to avoid second deallocation later in the function. --- src/share/utf8/iconvert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/share/utf8/iconvert.c b/src/share/utf8/

[flac-dev] [PATCH 3/2] Free memory on errors in all safe_realloc_*() functions

2018-07-20 Thread Miroslav Lichvar
--- include/share/alloc.h | 36 +--- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/include/share/alloc.h b/include/share/alloc.h index 63878db0..97752f0c 100644 --- a/include/share/alloc.h +++ b/include/share/alloc.h @@ -174,34 +174,46 @@ static in