Closed a memory leak with message sieve. Coverity CID 28738.
This commit is contained in:
parent
76857d7dd2
commit
d5130abb96
@ -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;
|
||||
|
@ -1 +1 @@
|
||||
#define Xorriso_timestamP "2015.10.25.123601"
|
||||
#define Xorriso_timestamP "2015.11.03.125130"
|
||||
|
Loading…
Reference in New Issue
Block a user