check return value of alloc functions, from Charles Longeau
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21745 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -306,6 +306,8 @@ getent(char **cap, size_t *len, char **db_array, int fd,
|
||||
/* save the data; close frees it */
|
||||
clen = strlen(record);
|
||||
cbuf = malloc(clen + 1);
|
||||
if (cbuf == NULL)
|
||||
return (-2);
|
||||
memmove(cbuf, record, clen + 1);
|
||||
if (capdbp->close(capdbp) < 0) {
|
||||
free(cbuf);
|
||||
|
Reference in New Issue
Block a user