X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_message_body.c;h=7019de30e763498b2e946ffd5df3ee00d80920bf;hp=1129c54930fa51823e52de22f8c71329f349d036;hb=4407379af8d886b627c88572e9da69c38cdbda58;hpb=00e24570e4af64936d3209bbbad2b0a7f88157a5 diff --git a/php_http_message_body.c b/php_http_message_body.c index 1129c54..7019de3 100644 --- a/php_http_message_body.c +++ b/php_http_message_body.c @@ -123,8 +123,12 @@ PHP_HTTP_API char *php_http_message_body_etag(php_http_message_body_t *body) } else { php_http_etag_t *etag = php_http_etag_init(PHP_HTTP_G->env.etag_mode TSRMLS_CC); - php_http_message_body_to_callback(body, (php_http_pass_callback_t) php_http_etag_update, etag, 0, 0); - return php_http_etag_finish(etag); + if (etag) { + php_http_message_body_to_callback(body, (php_http_pass_callback_t) php_http_etag_update, etag, 0, 0); + return php_http_etag_finish(etag); + } else { + return NULL; + } } } @@ -286,7 +290,7 @@ static inline char *format_key(uint type, char *str, ulong num, const char *pref } else if (type == HASH_KEY_IS_STRING) { new_key = estrdup(str); } else { - estrdup(""); + new_key = estrdup(""); } return new_key;