]> git.ipfire.org Git - thirdparty/chrony.git/commit
array: always return non-NULL pointer from ARR_GetElements()
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 1 Dec 2015 13:24:36 +0000 (14:24 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 2 Dec 2015 11:04:09 +0000 (12:04 +0100)
commit934df19c52981628f8d154a1fee4c2dbee31c61f
tree76078214afba7061a1caa1c87ee297b18adf670e
parent024842a38b9cff743de8101429f1c8e693070730
array: always return non-NULL pointer from ARR_GetElements()

Some libc calls like memcpy() expect the pointer to be valid even when
the size is zero and there is nothing to do. Instead of checking the
size before all such calls, modify ARR_GetElements() to return a pointer
to the array instance itself if data was not allocated yet.
array.c