Skip to content

Commit

Permalink
[CORE] Added memory check (#1638)
Browse files Browse the repository at this point in the history
  • Loading branch information
acetcom committed Jul 1, 2022
1 parent 6adf541 commit 318fc25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core/ogs-pkbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@ ogs_pkbuf_t *ogs_pkbuf_copy_debug(ogs_pkbuf_t *pkbuf, const char *file_line)
{
#if OGS_USE_TALLOC
ogs_pkbuf_t *newbuf;
int size = pkbuf->end - pkbuf->head;
int size = 0;

ogs_assert(pkbuf);
size = pkbuf->end - pkbuf->head;
ogs_assert(size > 0);
newbuf = ogs_pkbuf_alloc_debug(NULL, size, file_line);
if (!newbuf) {
Expand Down

0 comments on commit 318fc25

Please sign in to comment.