commit b52a86714bba04f826260961a12de21e318e65ae
parent abe30cec37600ad3c4ad49ccee0cde5ffdd65480
Author: vaplv <vaplv@free.fr>
Date: Mon, 8 May 2017 16:04:24 +0200
Fix an error handling issue in big buffer init
On init error, ensure that the big buffer release does not try to flush
buffered data if no valid stream is associated to the big buffer.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/big_buffer.h b/src/big_buffer.h
@@ -249,6 +249,9 @@ BIGBUF_FUNC__(init)
exit:
return res;
error:
+ /* Reset the file to NULL to not flush buffered data during bigbuf release */
+ if(bigbuf->temp_file) fclose(bigbuf->file);
+ bigbuf->file = NULL;
BIGBUF_FUNC__(release)(bigbuf);
goto exit;
}