diff options
author | Luke Leighton <lkcl@samba.org> | 1999-12-12 20:03:42 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-12-12 20:03:42 +0000 |
commit | 4f8a24522c683761c6f2ee23dba56f6c7913377b (patch) | |
tree | fef9baa89fc7695fe462cbace85a0f4276845d53 /source3/lib/util_array.c | |
parent | 0ce128e3550794d4dbbd1def00e87c020f72c992 (diff) | |
download | samba-4f8a24522c683761c6f2ee23dba56f6c7913377b.tar.gz samba-4f8a24522c683761c6f2ee23dba56f6c7913377b.tar.bz2 samba-4f8a24522c683761c6f2ee23dba56f6c7913377b.zip |
final part of "first" phase converting over to msrpc daemon architecture.
done a minimal amout of clean-up in the Makefile, removing unnecessary
modules from the link stage. this is not complete, yet, and will
involve some changes, for example to smbd, to remove dependencies on
the password database API that shouldn't be there. for example,
smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa
API.
this first implementation has minor problems with not reinstantiating
the same services as the caller. the "homes" service is a good example.
(This used to be commit caa50525220b0d0250fa139367593c2de2c12135)
Diffstat (limited to 'source3/lib/util_array.c')
-rw-r--r-- | source3/lib/util_array.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/lib/util_array.c b/source3/lib/util_array.c index 5a21053cc6..c3945ff9f8 100644 --- a/source3/lib/util_array.c +++ b/source3/lib/util_array.c @@ -42,6 +42,7 @@ void free_void_array(uint32 num_entries, void **entries, void* add_copy_to_array(uint32 *len, void ***array, const void *item, void*(item_dup)(const void*), BOOL alloc_anyway) { + void* copy = NULL; if (len == NULL || array == NULL) { return NULL; @@ -49,14 +50,10 @@ void* add_copy_to_array(uint32 *len, void ***array, const void *item, if (item != NULL || alloc_anyway) { - void* copy = NULL; - if (item != NULL || alloc_anyway) - { - copy = item_dup(item); - } - add_item_to_array(len, array, copy); + copy = item_dup(item); + return add_item_to_array(len, array, copy); } - return NULL; + return copy; } void* add_item_to_array(uint32 *len, void ***array, void *item) |