diff options
author | Nathan Scott <nathans@sgi.com> | 2003-02-18 23:34:40 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2003-02-18 23:34:40 +0000 |
commit | 61ac9c1b4356010afd3bb329c3a41e99a115d768 (patch) | |
tree | 64cd137a4844123d8f9e9c79dff0055ecd2f5ff9 /libacl | |
parent | 40efd906cb3752531009a962496da7b4e4d42556 (diff) | |
download | acl-61ac9c1b4356010afd3bb329c3a41e99a115d768.tar.gz |
Fix a zero-length malloc in acl_init - causing QA failures when libacl
is linked with the electric fence library.
Diffstat (limited to 'libacl')
-rw-r--r-- | libacl/acl_init.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libacl/acl_init.c b/libacl/acl_init.c index a8d45a0..4448d82 100644 --- a/libacl/acl_init.c +++ b/libacl/acl_init.c @@ -40,8 +40,11 @@ __acl_init_obj(int count) aprealloc == aprealloc_end is true when no more pre-allocated entries are available. */ - acl_obj_p->aprealloc = (acl_entry_obj *) - malloc(count * sizeof(acl_entry_obj)); + if (count > 0) + acl_obj_p->aprealloc = (acl_entry_obj *) + malloc(count * sizeof(acl_entry_obj)); + else + acl_obj_p->aprealloc = NULL; if (acl_obj_p->aprealloc != NULL) acl_obj_p->aprealloc_end = acl_obj_p->aprealloc + count; else |