From 12419412038c3598152910410a6b4dc494f3eee6 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 3 Nov 2015 12:52:09 +0000 Subject: [PATCH] Closed a memory leak with message sieve. Coverity CID 28738. --- xorriso/text_io.c | 4 ++-- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xorriso/text_io.c b/xorriso/text_io.c index c2754ae0..6253cba6 100644 --- a/xorriso/text_io.c +++ b/xorriso/text_io.c @@ -2185,6 +2185,8 @@ int Xorriso_sieve_filter_msg(struct XorrisO *xorriso, char *msg, int flag) l= strlen(prefix); if(strlen(msg) >= (unsigned int) l) { if(l - skip == 0 || strncmp(prefix + skip, msg + skip, l - skip) == 0) { + Xorriso_free_meM(prefix_storage); + prefix_storage= NULL; Xorriso_alloc_meM(prefix_storage, char, l + 1); strncpy(prefix_storage, msg, l); prefix_storage[l]= 0; @@ -2275,8 +2277,6 @@ int Xorriso_sieve_filter_msg(struct XorrisO *xorriso, char *msg, int flag) prev_lst= lst; } (f->num_results)++; - Xorriso_free_meM(prefix_storage); - prefix_storage= NULL; Xorriso__dispose_words(&argc, &argv); } ret= 1; diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 6748b5c5..a8ab0b9b 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2015.10.25.123601" +#define Xorriso_timestamP "2015.11.03.125130"