diff options
-rw-r--r-- | sys/kern/kern_linker.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 55ad60e..026d5b6 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -620,9 +620,8 @@ linker_file_unload(linker_file_t file, int flags) free(file->deps, M_LINKER); file->deps = NULL; } - for (cp = STAILQ_FIRST(&file->common); cp; - cp = STAILQ_FIRST(&file->common)) { - STAILQ_REMOVE(&file->common, cp, common_symbol, link); + while ((cp = STAILQ_FIRST(&file->common)) != NULL) { + STAILQ_REMOVE_HEAD(&file->common, link); free(cp, M_LINKER); } |