diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-09-24 05:02:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:50 -0500 |
commit | 6e4ebbed8928d618f56c06bfc0802891c3d939ab (patch) | |
tree | dddf568c469de74d804a1b7c7bc8da99f4021e21 /source4/lib/tdb/common | |
parent | d98b913aa9a0dd40a9373d65882f1cb742d033af (diff) | |
download | samba-6e4ebbed8928d618f56c06bfc0802891c3d939ab.tar.gz samba-6e4ebbed8928d618f56c06bfc0802891c3d939ab.tar.bz2 samba-6e4ebbed8928d618f56c06bfc0802891c3d939ab.zip |
r10467: aix doesn't like zero length malloc :(
(This used to be commit 0177c6ca3e9baa223b5f7b29adc12d862dcb19d8)
Diffstat (limited to 'source4/lib/tdb/common')
-rw-r--r-- | source4/lib/tdb/common/io.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/tdb/common/io.c b/source4/lib/tdb/common/io.c index a276a8c291..e9d4e87ac8 100644 --- a/source4/lib/tdb/common/io.c +++ b/source4/lib/tdb/common/io.c @@ -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; |