]> jfr.im git - irc/atheme/libmowgli-2.git/commit
core/alloc.c, core/allocator.c: fix calloc(3) and free(3) usage
authorAaron Jones <redacted>
Fri, 18 Jan 2019 04:22:15 +0000 (04:22 +0000)
committerAaron Jones <redacted>
Fri, 18 Jan 2019 04:28:28 +0000 (04:28 +0000)
commitf7ab89768d113083f14e0c84b8cd81755baacc82
tree97b3920ac30ba60dc886012a63ed6d02cd950b00
parent8c26f03e2b06bc186fab209cc24745cd0b921549
core/alloc.c, core/allocator.c: fix calloc(3) and free(3) usage

calloc(3)'s 2 arguments are, in order: number of members, size of member.
-> Swap the arguments to the correct order.

free(3) is well-documented to do nothing when passed NULL.
-> Remove conditional check for non-NULL.

Also add malloc and alloc_size function attributes where necessary.
src/libmowgli/core/alloc.c
src/libmowgli/core/allocator.c