HMS_fetch_rules: Return NULL if the curl connection failed, instead of producing garbled rules
This commit is contained in:
1 parent
a6fc237c88
commit
4b69b39d39
1 file changed
+6
-1
+6
-1
@@ -532,7 +532,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");
|
||||
|
||||
@@ -550,6 +552,9 @@ HMS_fetch_rules (char *buffer, size_t buffer_size)
|
||||
|
||||
HMS_end(hms);
|
||||
|
||||
if (!ok)
|
||||
return NULL;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user