- check for success
authorMichael Wallner <mike@php.net>
Mon, 11 Apr 2005 10:12:26 +0000 (10:12 +0000)
committerMichael Wallner <mike@php.net>
Mon, 11 Apr 2005 10:12:26 +0000 (10:12 +0000)
http_message_api.c

index 0dec4095e2374c4e353f229e374e3837ead41dfb..a4490d8c4535b5a16d31535ebbd45b71bc7a05ed 100644 (file)
@@ -66,7 +66,10 @@ PHP_HTTP_API http_message *_http_message_parse_ex(char *message, size_t message_
                header_length = message_length;
        }
        
-       http_parse_headers_cb(message, header_length, &msg->hdrs, 1, http_message_parse_headers_callback, (void **) &msg);
+       if (SUCCESS != http_parse_headers_cb(message, header_length, &msg->hdrs, 1, http_message_parse_headers_callback, (void **) &msg)) {
+               http_message_free(msg);
+               return NULL;
+       }
        
        if (body) {
                phpstr_from_string_ex(PHPSTR(msg), body, message_length - header_length);