Check for potential null pointer#61
Conversation
|
With APR pools, the accepted coding style is to assume |
Thank you for your kind reply and explanation! For example: apr/threadproc/netware/threadpriv.c Lines 25 to 27 in 4283c6a Lines 71 to 73 in 4283c6a So I thought it might be good to follow a consistent assumption? I must admit that I didn't have experience contributing to the APR repo before. My apologies if my understanding is inaccurate, and thank you again for your time! |
|
You're right that not all APR code follows the convention, unfortunately. |
apr_pallocmay return NULL pointer. It may trigger undefined behavior in later usage. For example, passing a null pointer tomemcpymay trigger undefined behavior. Thus it is better to check for NULL.