mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-23 16:01:42 +00:00
Fix memory leak on error.
Found with: Coverity Prevent(tm) MFC after: 1 month
This commit is contained in:
parent
73dd1f4339
commit
d66caf62a2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208860
@ -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 New Issue
Block a user