aboutsummaryrefslogtreecommitdiff
path: root/modules/devices/devicetree/pmac_data.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2017-07-23 00:35:02 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2017-07-24 18:07:58 -0700
commit1d6415ed07283ecf026f23d73203b9a133909322 (patch)
tree24579bf17f333aaaec3c8b2fda1880cd9c0abe6e /modules/devices/devicetree/pmac_data.c
parent5922e1335dae6966fb6d0651090864e12ee87a1f (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/devices/devicetree/pmac_data.c')
-rw-r--r--modules/devices/devicetree/pmac_data.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/devices/devicetree/pmac_data.c b/modules/devices/devicetree/pmac_data.c
index 41d3a105..01b08419 100644
--- a/modules/devices/devicetree/pmac_data.c
+++ b/modules/devices/devicetree/pmac_data.c
@@ -38,6 +38,10 @@ static gchar *ppc_mac_details(void) {
return NULL;
while (fgets(buffer, 128, cpuinfo)) {
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]);
get_str("platform", platform);