summaryrefslogtreecommitdiff
path: root/hardinfo
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-06-28 23:49:49 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-06-29 17:58:52 -0700
commit66d0e31b047067054e161cff1a62234565331390 (patch)
treefdf03f70db45dc5b55f830dadeb1538d3b5caa39 /hardinfo
parent6f8fc6a5816b2d404ad41a8b84830006a5b473e2 (diff)
dmi_util: make cache static, use cache free function
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo')
-rw-r--r--hardinfo/dmi_util.c2
-rw-r--r--hardinfo/hardinfo.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/hardinfo/dmi_util.c b/hardinfo/dmi_util.c
index 55e21c4d..627d1cd0 100644
--- a/hardinfo/dmi_util.c
+++ b/hardinfo/dmi_util.c
@@ -235,7 +235,7 @@ char *dmi_chassis_type_str(int chassis_type, gboolean with_val) {
}
/* TODO: something better maybe */
-char *dd_cache[128] = {};
+static char *dd_cache[128] = {};
void dmidecode_cache_free()
{ int i; for(i = 0; i < 128; i++) g_free(dd_cache[i]); }
diff --git a/hardinfo/hardinfo.c b/hardinfo/hardinfo.c
index d1d228b3..6e812fb1 100644
--- a/hardinfo/hardinfo.c
+++ b/hardinfo/hardinfo.c
@@ -161,6 +161,7 @@ int main(int argc, char **argv)
moreinfo_shutdown();
vendor_cleanup();
+ dmidecode_cache_free();
DEBUG("finished");
return exit_code;