Skip to content

Commit c1d2c63

Browse files
committed
scheduler: Fix possible use_after_free in cupsdReadClient()
If `cupsdSendHeader()` fails, we free the connection and return -1, but in that case we try to free the connection again in `cupsdReadClient()`.
1 parent 764b8bf commit c1d2c63

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

scheduler/client.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,10 +2761,7 @@ check_start_tls(cupsd_client_t *con) /* I - Client connection */
27612761
httpSetField(con->http, HTTP_FIELD_CONTENT_LENGTH, "0");
27622762

27632763
if (!cupsdSendHeader(con, HTTP_STATUS_OK, NULL, CUPSD_AUTH_NONE))
2764-
{
2765-
cupsdCloseClient(con);
27662764
return (-1);
2767-
}
27682765
}
27692766

27702767
return (1);

0 commit comments

Comments
 (0)