summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-11-13 03:57:48 +0200
committerKarolin Seeger <kseeger@samba.org>2009-11-26 11:40:53 +0100
commit068cbdb5e264ab072b7914aaa3f9b925f26a5ceb (patch)
tree444e8a309418e9ee84a7d0b392fb7ac4857d3ab9 /lib
parent44c2030a3b5f09e3041b14b1646481fe9ad496a4 (diff)
downloadsamba-068cbdb5e264ab072b7914aaa3f9b925f26a5ceb.tar.gz
util: str_list_unique() bugfix
j is actually the index of the last element in the list size of the list though is j+1 <- to make room for the terminating NULL element (cherry picked from commit 5b75201dbb9f2e6799fd5c3eee8da6230caee96c) (cherry picked from commit 8a5c8d559e6b34544a3cc0811d269d46bcad5182)
Diffstat (limited to 'lib')
-rw-r--r--lib/util/util_strlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util/util_strlist.c b/lib/util/util_strlist.c
index 1331fee6a70..8d69eef2333 100644
--- a/lib/util/util_strlist.c
+++ b/lib/util/util_strlist.c
@@ -401,7 +401,7 @@ _PUBLIC_ const char **str_list_unique(const char **list)
}
}
list[j] = NULL;
- list = talloc_realloc(NULL, list, const char *, j);
+ list = talloc_realloc(NULL, list, const char *, j + 1);
talloc_free(list2);
return list;
}