summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/env.c3
-rw-r--r--coreutils/od_bloaty.c3
-rw-r--r--coreutils/sort.c4
3 files changed, 3 insertions, 7 deletions
diff --git a/coreutils/env.c b/coreutils/env.c
index e21740d..8d8753e 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -62,8 +62,7 @@ int env_main(int argc ATTRIBUTE_UNUSED, char **argv)
environ = cleanenv;
} else {
while (unset_env) {
- unsetenv(unset_env->data);
- unset_env = unset_env->link;
+ unsetenv(llist_pop(&unset_env));
}
}
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index 5e22875..ce963db 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -1281,8 +1281,7 @@ int od_main(int argc, char **argv)
if (opt & OPT_o) decode_format_string("o2");
//if (opt & OPT_t)...
while (lst_t) {
- decode_format_string(lst_t->data);
- lst_t = lst_t->link;
+ decode_format_string(llist_pop(&lst_t));
}
if (opt & OPT_v) verbose = 1;
if (opt & OPT_x) decode_format_string("x2");
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 12b463a..1f531fb 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -314,7 +314,7 @@ int sort_main(int argc ATTRIBUTE_UNUSED, char **argv)
0
};
struct sort_key *key = add_key();
- char *str_k = lst_k->data;
+ char *str_k = llist_pop(&lst_k);
const char *temp2;
i = 0; /* i==0 before comma, 1 after (-k3,6) */
@@ -344,8 +344,6 @@ int sort_main(int argc ATTRIBUTE_UNUSED, char **argv)
str_k++;
}
}
- /* leaking lst_k... */
- lst_k = lst_k->link;
}
#endif
/* global b strips leading and trailing spaces */