mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Fix memory leak on error.
Found with: Coverity Prevent(tm) MFC after: 1 month
This commit is contained in:
parent
73dd1f4339
commit
d66caf62a2
1 changed files with 3 additions and 1 deletions
|
|
@ -549,8 +549,10 @@ pmclog_open(int fd)
|
|||
|
||||
/* allocate space for a work area */
|
||||
if (ps->ps_fd != PMCLOG_FD_NONE) {
|
||||
if ((ps->ps_buffer = malloc(PMCLOG_BUFFER_SIZE)) == NULL)
|
||||
if ((ps->ps_buffer = malloc(PMCLOG_BUFFER_SIZE)) == NULL) {
|
||||
free(ps);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return ps;
|
||||
|
|
|
|||
Loading…
Reference in a new issue