summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 33fdd01)
raw | patch | inline | side by side (parent: 33fdd01)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 30 Apr 2010 15:50:16 +0000 (15:50 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 30 Apr 2010 15:50:16 +0000 (15:50 +0000) |
response_read. I've found it to get stuck otherwise. -- Thorsten von Eicken
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2075 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2075 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_client.c | patch | blob | history |
index b677d4f37e439746e6fd0e697ae538468c036798..b895237c52410598f0f03b1b77b8143fa0879663 100644 (file)
--- a/program/src/rrd_client.c
+++ b/program/src/rrd_client.c
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);
}
}