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

master
Thomas Schmitt 7 years ago
parent b848d002d9
commit 1241941203
  1. 4
      xorriso/text_io.c
  2. 2
      xorriso/xorriso_timestamp.h

@ -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…
Cancel
Save