diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2018-03-27 21:28:27 +0000 |
---|---|---|
committer | Federico Ceratto <federico.ceratto@gmail.com> | 2018-03-27 21:28:27 +0000 |
commit | eb7cc2640201f168bbd9a05799fd2dbe823bb57c (patch) | |
tree | 1f88da02b7ee3c16ced7b5f7dc4aadb190766e7c /src/proc_self_mountinfo.c | |
parent | Release v. 1.9.0+dfsg-1 to Unstable (diff) | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-eb7cc2640201f168bbd9a05799fd2dbe823bb57c.tar.xz netdata-eb7cc2640201f168bbd9a05799fd2dbe823bb57c.zip |
Update upstream source from tag 'upstream/1.10.0+dfsg'
Update to upstream version '1.10.0+dfsg'
with Debian dir fa5485f3d9aea3038a19eff06ba33374ac5c5d7c
Diffstat (limited to 'src/proc_self_mountinfo.c')
-rw-r--r-- | src/proc_self_mountinfo.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/proc_self_mountinfo.c b/src/proc_self_mountinfo.c index bb031a9ab..4ccdddff1 100644 --- a/src/proc_self_mountinfo.c +++ b/src/proc_self_mountinfo.c @@ -103,20 +103,11 @@ struct mountinfo *mountinfo_find_by_filesystem_super_option(struct mountinfo *ro return NULL; } - -// free a linked list of mountinfo structures -void mountinfo_free(struct mountinfo *mi) { - if(unlikely(!mi)) - return; - - if(likely(mi->next)) - mountinfo_free(mi->next); - +static void mountinfo_free(struct mountinfo *mi) { freez(mi->root); freez(mi->mount_point); freez(mi->mount_options); freez(mi->persistent_id); - /* if(mi->optional_fields_count) { int i; @@ -131,6 +122,16 @@ void mountinfo_free(struct mountinfo *mi) { freez(mi); } +// free a linked list of mountinfo structures +void mountinfo_free_all(struct mountinfo *mi) { + while(mi) { + struct mountinfo *t = mi; + mi = mi->next; + + mountinfo_free(t); + } +} + static char *strdupz_decoding_octal(const char *string) { char *buffer = strdupz(string); |