diff options
author | Burt P <pburt0@gmail.com> | 2017-07-23 00:35:02 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-07-24 18:07:58 -0700 |
commit | 1d6415ed07283ecf026f23d73203b9a133909322 (patch) | |
tree | 24579bf17f333aaaec3c8b2fda1880cd9c0abe6e /modules/computer | |
parent | 5922e1335dae6966fb6d0651090864e12ee87a1f (diff) |
Check for NULL before g_strstrip() to assertion failure warnings
GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/computer')
-rw-r--r-- | modules/computer/memory.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/computer/memory.c b/modules/computer/memory.c index 44b83df4..dc8599c2 100644 --- a/modules/computer/memory.c +++ b/modules/computer/memory.c @@ -33,7 +33,10 @@ computer_get_memory(void) while (fgets(buffer, 128, procmem)) { gchar **tmp = g_strsplit(buffer, ":", 2); - + if (tmp[1] == NULL) { + g_strfreev(tmp); + continue; + } tmp[0] = g_strstrip(tmp[0]); tmp[1] = g_strstrip(tmp[1]); |