Dropped to allocate memory for comments when there are none.
1 unresolved thread
1 unresolved thread
This avoid calling malloc(0) expecting a non-NULL pointer returned, and make the code in oc_comment_unpack() not depend on non POSIX specified behaviour.
Thanks to Eric Lasota for noticing.
Fixes #2304 (closed)
Merge request reports
Activity
added 1 commit
- b8d18cda - Dropped to allocate memory for comments when there are none.
added 1 commit
- b07580c8 - Dropped to allocate memory for comments when there are none.
added 1 commit
- e0c7c2bb - Ensured comment_lengths and user_comments are NULL if there are no comments.
I don't think that addition hurts anything. The pointers need to be NULL already or the returns on lines 124, 126, or 134 would be problematic, as th_comment_clear() is called at line 223 (now 225) if this function fails. I agree it is not the most bullet-proof API design, but I did not design this particular piece of the API.
added 1 commit
- 8f4aba13 - Dropped to allocate memory for comments when there are none.
Please register or sign in to reply