X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_message_object.c;h=88456812d7bffa33eb2f780c9b57455ce5b5cc0f;hp=d01c256ed32e3efd63977f548b38760f48341c74;hb=3790a41ee6c48417d9570ec507e6490bcde0736f;hpb=42ed05ae82599af080b95f073809da8a8b47c84b 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; }