Add pool callback#3517
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR updates request-body pool initialization to propagate the parent pool’s APR abort callback to the newly created msc_reqbody_mp pool.
Changes:
- Set
msc_reqbody_mp’s abort function to matchmsr->mpviaapr_pool_abort_set(apr_pool_abort_get(msr->mp), ...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| apr_pool_create(&msr->msc_reqbody_mp, NULL); | ||
|
|
||
| apr_pool_abort_set(apr_pool_abort_get(msr->mp), msr->msc_reqbody_mp); | ||
| /* Initialise request body processors, if any. */ |
There was a problem hiding this comment.
apr_pool_create(&msr->msc_reqbody_mp, NULL); returns an apr_status_t, but the result isn’t checked before calling apr_pool_abort_set(...) (and later using msr->msc_reqbody_mp). If pool creation fails, this will immediately dereference a NULL pool. Capture the return code, and on failure set *error_msg and return an error before using msr->msc_reqbody_mp.



This is a Marc Stern modification, I don't have much more insight on the code he made. To be reviewed with caution and check if this is still relevant