Skip to content

Commit

Permalink
fts-squat: Fixed memory leak on corrupted uidlist handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and GitLab committed Sep 13, 2016
1 parent 262eeae commit 67a0f9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/fts-squat/squat-uidlist.c
Expand Up @@ -195,8 +195,11 @@ uidlist_write_array(struct ostream *output, const uint32_t *uid_list,
prev = 0;
for (i = 0; i < uid_count; i++) {
uid = uid_list[i];
if (unlikely((uid & ~UID_LIST_MASK_RANGE) < prev))
if (unlikely((uid & ~UID_LIST_MASK_RANGE) < prev)) {
if (!datastack)
i_free(uidbuf);
return -1;
}
if ((uid & UID_LIST_MASK_RANGE) == 0) {
squat_pack_num(&bufp, (uid - prev) << 1);
prev = uid + 1;
Expand Down

0 comments on commit 67a0f9e

Please sign in to comment.