Skip to content

Commit bcf5085

Browse files
Update src/monitord/sendcustomemail.c
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9cd95f0 commit bcf5085

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/monitord/sendcustomemail.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,13 @@ int OS_SendCustomEmail2(char **to, char *subject, char *fname, monitor_config *m
320320
i++;
321321
continue;
322322
}
323-
recipients = curl_slist_append(recipients, to[i]);
323+
struct curl_slist *tmp_recipients = curl_slist_append(recipients, to[i]);
324+
if (!tmp_recipients) {
325+
merror("%s: ERROR: Memory error building recipient list.", ARGV0);
326+
res = CURLE_OUT_OF_MEMORY;
327+
goto cleanup_curl;
328+
}
329+
recipients = tmp_recipients;
324330
i++;
325331
}
326332

0 commit comments

Comments
 (0)