Skip to content

Commit

Permalink
acc: Improve oom handling
Browse files Browse the repository at this point in the history
Do not populate bogus str values (e.g. {NULL, 3}) when out of SHM and
setting $acc_extra.

(cherry picked from commit 86ef10a)
  • Loading branch information
liviuchircu committed Mar 24, 2020
1 parent 923ba62 commit 9523af5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/acc/acc_vars.c
Expand Up @@ -165,8 +165,10 @@ int set_value_shm(pv_value_t* pvt, extra_value_t* extra)
extra->value.len = s.len;
}

if (extra->value.s == NULL)
if (extra->value.s == NULL) {
extra->shm_buf_len = extra->value.len = 0;
goto memerr;
}

memcpy(extra->value.s, s.s, s.len);
}
Expand Down

0 comments on commit 9523af5

Please sign in to comment.