git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b7839b7
)
util: str_list_unique() bugfix
author
Kamen Mazdrashki
<kamen.mazdrashki@postpath.com>
Fri, 13 Nov 2009 01:57:48 +0000
(
03:57
+0200)
committer
Andrew Bartlett
<abartlet@samba.org>
Fri, 13 Nov 2009 12:19:06 +0000
(23:19 +1100)
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
lib/util/util_strlist.c
patch
|
blob
|
history
diff --git
a/lib/util/util_strlist.c
b/lib/util/util_strlist.c
index 1331fee6a70c9c9a753c09dcfe4e16638926c1e8..8d69eef23336fd8830684b4b73b664260222295f 100644
(file)
--- 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[j] = NULL;
- list = talloc_realloc(NULL, list, const char *, j);
+ list = talloc_realloc(NULL, list, const char *, j
+ 1
);
talloc_free(list2);
return list;
}
talloc_free(list2);
return list;
}