X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_message_object.c;h=88456812d7bffa33eb2f780c9b57455ce5b5cc0f;hp=d01c256ed32e3efd63977f548b38760f48341c74;hb=4335ae84338de0949883027c565fb680b9461a38;hpb=55f4b48b1127717e2a3ce16344b530eb609c9e1a diff --git a/http_message_object.c b/http_message_object.c index d01c256..8845681 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -393,6 +393,10 @@ void _http_message_object_free(zend_object *object TSRMLS_DC) { http_message_object *o = (http_message_object *) object; + if (o->iterator) { + zval_ptr_dtor(&o->iterator); + o->iterator = NULL; + } if (o->message) { http_message_dtor(o->message); efree(o->message); @@ -1132,9 +1136,9 @@ PHP_METHOD(HttpMessage, setHttpVersion) } convert_to_double(zv); - sprintf(v, "%1.1lf", Z_DVAL_P(zv)); + snprintf(v, sizeof(v), "%1.1f", Z_DVAL_P(zv)); if (strcmp(v, "1.0") && strcmp(v, "1.1")) { - http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %s", v); + http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %g", Z_DVAL_P(zv)); RETURN_FALSE; }