HMS_fetch_rules: Return NULL if the curl connection failed, instead of producing garbled rules

This commit is contained in:
toaster 2023-08-28 23:33:39 +01:00
parent 782d98fb09
commit 339d368d7d

View file

@ -526,7 +526,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
if (! hms)
return NULL;
if (HMS_do(hms))
boolean ok = HMS_do(hms);
if (ok)
{
char *p = strstr(hms->buffer, "\n\n");
@ -542,6 +544,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
HMS_end(hms);
if (!ok)
return NULL;
return buffer;
}