Closed a memory leak with message sieve. Coverity CID 28738.
This commit is contained in:
parent
b848d002d9
commit
1241941203
@ -2185,6 +2185,8 @@ int Xorriso_sieve_filter_msg(struct XorrisO *xorriso, char *msg, int flag)
|
|||||||
l= strlen(prefix);
|
l= strlen(prefix);
|
||||||
if(strlen(msg) >= (unsigned int) l) {
|
if(strlen(msg) >= (unsigned int) l) {
|
||||||
if(l - skip == 0 || strncmp(prefix + skip, msg + skip, l - skip) == 0) {
|
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);
|
Xorriso_alloc_meM(prefix_storage, char, l + 1);
|
||||||
strncpy(prefix_storage, msg, l);
|
strncpy(prefix_storage, msg, l);
|
||||||
prefix_storage[l]= 0;
|
prefix_storage[l]= 0;
|
||||||
@ -2275,8 +2277,6 @@ int Xorriso_sieve_filter_msg(struct XorrisO *xorriso, char *msg, int flag)
|
|||||||
prev_lst= lst;
|
prev_lst= lst;
|
||||||
}
|
}
|
||||||
(f->num_results)++;
|
(f->num_results)++;
|
||||||
Xorriso_free_meM(prefix_storage);
|
|
||||||
prefix_storage= NULL;
|
|
||||||
Xorriso__dispose_words(&argc, &argv);
|
Xorriso__dispose_words(&argc, &argv);
|
||||||
}
|
}
|
||||||
ret= 1;
|
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