AT: Better failure handling and removed wrong unlock
[hayes-ril.git] / network.c
index 1188b07..62d359d 100644 (file)
--- a/network.c
+++ b/network.c
@@ -182,8 +182,10 @@ int at_creg_handle(char **registration_state, struct at_response_data **response
        }
 
        asprintf(&(registration_state[0]), "%d", state);
-       registration_state[1] = strdup(lac);
-       registration_state[2] = strdup(cid);
+       if(lac != NULL)
+               registration_state[1] = strdup(lac);
+       if(cid != NULL)
+               registration_state[2] = strdup(cid);
 
        return 0;
 }
@@ -332,7 +334,7 @@ char *at_cops_request(int index)
 
        free(response);
        free(data);
-LOGE(">%s<", result);
+
        return result;
 
 error: