Closed a memory leak with message sieve. Coverity CID 28738.

This commit is contained in:
Thomas Schmitt 2015-11-03 12:52:09 +00:00
parent 76857d7dd2
commit d5130abb96
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.10.25.123601"
#define Xorriso_timestamP "2015.11.03.125130"