response_read. I've found it to get stuck otherwise. -- Thorsten von Eicken
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2075
a5681a0c-68f1-0310-ab6d-
d61299d08faa
ret->lines_num = 0;
buffer_ptr = fgets (buffer, sizeof (buffer), sh);
- if (buffer_ptr == NULL)
+ if (buffer_ptr == NULL) {
+ close_connection();
return (-3);
+ }
chomp (buffer);
ret->status = strtol (buffer, &ret->message, 0);
if (buffer == ret->message)
{
response_free (ret);
+ close_connection();
return (-4);
}
/* Skip leading whitespace of the status message */
if (ret->lines == NULL)
{
response_free (ret);
+ close_connection();
return (-5);
}
memset (ret->lines, 0, sizeof (char *) * ret->status);
if (buffer_ptr == NULL)
{
response_free (ret);
+ close_connection();
return (-6);
}
chomp (buffer);
if (ret->lines[i] == NULL)
{
response_free (ret);
+ close_connection();
return (-7);
}
}