Skip to content

Commit

Permalink
Update allow_list.c
Browse files Browse the repository at this point in the history
potential memory leak #1092
  • Loading branch information
RainRat committed Nov 18, 2023
1 parent 47c079f commit e763cfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clamav-milter/allow_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ int smtpauth_init(const char *r)
if (len <= 0) continue;
if (len * 3 + 1 > rxavail) {
ptr = regex;
regex = realloc(regex, rxsize + 2048);
if (!regex) {
char *temp = realloc(regex, rxsize + 2048);
if (!temp) {
free(regex);
logg(LOGG_ERROR, "Cannot allocate memory for SkipAuthenticated file\n");
fclose(f);
return 1;
}
regex = temp;
rxavail = 2048;
rxsize += 2048;
if (!ptr) {
Expand Down

0 comments on commit e763cfb

Please sign in to comment.