Skip to content

Commit

Permalink
smax-lazy: Potential memory leak in case of error.
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Sep 24, 2024
1 parent 086c7e5 commit cff558e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/smax-lazy.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,9 @@ static LazyMonitor *CreateMonitorAsync(const char *table, const char *key, XType
id = xGetAggregateID(table, key);
m->channel = calloc(1, sizeof(SMAX_UPDATES) + strlen(id));
if(!m->channel) {
x_error(0, errno, fn, "calloc() error (%d bytes)", sizeof(SMAX_UPDATES) + strlen(id));
free(m);
x_error(0, errno, fn, "calloc() error (%d bytes)", sizeof(SMAX_UPDATES) + strlen(id));
free(id);
return NULL;
}

Expand Down

0 comments on commit cff558e

Please sign in to comment.