You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A crash when ippDelete(request) or ippDelete(response) is called #1349
Hello
I use cupsSendRequest to get printer status information. After successfully calling cupsGetResponse, should I immediately delete the request object with ippDelete? If I read the response attributes first and then call ippDelete in sequence, will there be any issues?
This is my code:
ipp_t *request = NULL;
ipp_t *response = NULL;
http_status_t result;
request = ippNewRequest(op);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes",
sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs);
do {
result = cupsSendRequest(http, request, resource, ippLength(request));
if (result <= HTTP_STATUS_CONTINUE || result == HTTP_STATUS_OK) {
response = cupsGetResponse(http, resource);
result = httpGetStatus(http);
}
if (result == HTTP_STATUS_ERROR || (result >= HTTP_STATUS_BAD_REQUEST &&
result != HTTP_STATUS_UNAUTHORIZED && result != HTTP_STATUS_UPGRADE_REQUIRED)) {
_cupsSetHTTPError(result);
break;
}
if (http->state != HTTP_STATE_WAITING) {
httpFlush(http);
}
} while (response == NULL);
if (response && (attrptr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) != NULL) {
printer_ippstate = (ipp_pstate_t) ippGetInteger(attrptr, 0);
}
ippDelete(request);
ippDelete(response);
changed the title [-]A crash when ippDelete(request) is called[/-][+]A crash when ippDelete(request) or ippDelete(response) is called[/+]on Sep 1, 2025
Activity
[-]A crash when ippDelete(request) is called[/-][+]A crash when ippDelete(request) or ippDelete(response) is called[/+]