1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

r10467: aix doesn't like zero length malloc :(

(This used to be commit 0177c6ca3e9baa223b5f7b29adc12d862dcb19d8)
This commit is contained in:
Andrew Tridgell 2005-09-24 05:02:02 +00:00 committed by Gerald (Jerry) Carter
parent d98b913aa9
commit 6e4ebbed89

View File

@ -351,6 +351,11 @@ unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len
{
unsigned char *buf;
/* some systems don't like zero length malloc */
if (len == 0) {
len = 1;
}
if (!(buf = malloc(len))) {
/* Ensure ecode is set for log fn. */
tdb->ecode = TDB_ERR_OOM;