chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
load-fragment: unify config_parse_condition_{kernel, virt}
[elogind.git]
/
src
/
strv.c
diff --git
a/src/strv.c
b/src/strv.c
index b1643b357fbddf9f69eb09d4ae2c8cde67b7dd5d..c5f8df06da6e8325b36dbbe0dec5b5dc54910fe4 100644
(file)
--- a/
src/strv.c
+++ b/
src/strv.c
@@
-78,9
+78,11
@@
char **strv_copy(char **l) {
return r;
fail:
return r;
fail:
- for (k--
, l--; k >= r; k--, l
--)
+ for (k--
; k >= r; k
--)
free(*k);
free(*k);
+ free(r);
+
return NULL;
}
return NULL;
}
@@
-355,7
+357,7
@@
char **strv_remove(char **l, const char *s) {
if (!l)
return NULL;
if (!l)
return NULL;
- /* Drops every occurence of s in the string list */
+ /* Drops every occur
r
ence of s in the string list */
for (f = t = l; *f; f++) {
for (f = t = l; *f; f++) {
@@
-379,7
+381,7
@@
static int env_append(char **r, char ***k, char **a) {
return 0;
/* Add the entries of a to *k unless they already exist in *r
return 0;
/* Add the entries of a to *k unless they already exist in *r
- * in which case they are overriden instead. This assumes
+ * in which case they are overrid
d
en instead. This assumes
* there is enough space in the r array. */
for (; *a; a++) {
* there is enough space in the r array. */
for (; *a; a++) {
@@
-435,6
+437,8
@@
char **strv_env_merge(unsigned n_lists, ...) {
return r;
fail:
return r;
fail:
+ va_end(ap);
+
for (k--; k >= r; k--)
free(*k);
for (k--; k >= r; k--)
free(*k);
@@
-474,7
+478,7
@@
char **strv_env_delete(char **x, unsigned n_lists, ...) {
char **l, **k, **r, **j;
va_list ap;
char **l, **k, **r, **j;
va_list ap;
- /* Deletes every entry fromx that is mentioned in the other
+ /* Deletes every entry from
x that is mentioned in the other
* string lists */
n = strv_length(x);
* string lists */
n = strv_length(x);