Fix memory leak on error.
Found with: Coverity Prevent(tm) MFC after: 1 month
This commit is contained in:
parent
73dd1f4339
commit
d66caf62a2
@ -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…
x
Reference in New Issue
Block a user