mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Avoid memory leak in test_event_calloc unit test; found by coverity
This commit is contained in:
parent
aa501e1a7e
commit
92817a11aa
@ -1150,6 +1150,7 @@ test_event_calloc(void *arg)
|
||||
tt_assert(p != NULL);
|
||||
tt_int_op(errno, ==, 0);
|
||||
mm_free(p);
|
||||
p = NULL;
|
||||
|
||||
/* mm_calloc() should set errno = ENOMEM and return NULL
|
||||
* in case of potential overflow. */
|
||||
@ -1160,6 +1161,9 @@ test_event_calloc(void *arg)
|
||||
|
||||
end:
|
||||
errno = 0;
|
||||
if (p)
|
||||
mm_free(p);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user