Use xreallocarray() instead of its pattern
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
190a702225
commit
f332379ea0
@ -60,12 +60,7 @@
|
|||||||
while (true) {
|
while (true) {
|
||||||
int status;
|
int status;
|
||||||
LOOKUP_TYPE *resbuf = NULL;
|
LOOKUP_TYPE *resbuf = NULL;
|
||||||
buffer = (char *)realloc (buffer, length);
|
buffer = (char *)xreallocarray (buffer, length, sizeof(char));
|
||||||
if (NULL == buffer) {
|
|
||||||
fprintf (log_get_logfd(), _("%s: out of memory\n"),
|
|
||||||
"x" STRINGIZE(FUNCTION_NAME));
|
|
||||||
exit (13);
|
|
||||||
}
|
|
||||||
status = REENTRANT_NAME(ARG_NAME, result, buffer,
|
status = REENTRANT_NAME(ARG_NAME, result, buffer,
|
||||||
length, &resbuf);
|
length, &resbuf);
|
||||||
if ((0 == status) && (resbuf == result)) {
|
if ((0 == status) && (resbuf == result)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user