huawei: report an error when ^PREFMODE reports no valid values

This patch fixes mm_huawei_parse_prefmode_test to always report an error when
returning NULL, which avoid a potential crash when the caller tries to access
the error.
This commit is contained in:
Ben Chan
2014-01-03 12:20:33 +01:00
committed by Aleksander Morgado
parent 52d34ce0db
commit cddc4af7bd
+4
View File
@@ -341,6 +341,10 @@ mm_huawei_parse_prefmode_test (const gchar *response,
/* No value */
if (out->len == 0) {
g_array_unref (out);
g_set_error (error,
MM_CORE_ERROR,
MM_CORE_ERROR_FAILED,
"^PREFMODE response contains no valid values");
return NULL;
}