summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a446780)
raw | patch | inline | side by side (parent: a446780)
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/branches/1.4@2075 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4@2075 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_client.c | patch | blob | history |
index 471e046fa42f3ae09849cc35c6539f7eab243e52..308965e22a802c768d447a2fabafc5a23a34f711 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);
}
}