diff --git a/dongle_apn.c b/dongle_apn.c index 4ca42d8565a322714b680ce55c997cbb5fbc5bec..2a698673a1e9144375b7f4f80e83fee6eba0b0df 100644 --- a/dongle_apn.c +++ b/dongle_apn.c @@ -26,7 +26,7 @@ int list_apn_profiles(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr, *dev; + char *ip_addr; struct json_object *response; ip_addr = strdup("192.168.0.1"); @@ -39,9 +39,6 @@ int list_apn_profiles(struct ubus_context *ctx, struct ubus_object *obj, free(ip_addr); return print_to_ubus(response, ctx, req); -fail_argument: - free(ip_addr); - return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: free(ip_addr); fail_strdup: @@ -193,9 +190,6 @@ int show_current_apn(struct ubus_context *ctx, struct ubus_object *obj, free(ip_addr); return print_to_ubus(response, ctx, req); -fail_argument: - free(ip_addr); - return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: free(ip_addr); fail_strdup: diff --git a/dongle_infrastructure.c b/dongle_infrastructure.c index cbf7fd82eddddfd4b0be5019bab41389acdb3f2b..dc179c2b08087f7a3aba621c0ca317fcafdb3c76 100644 --- a/dongle_infrastructure.c +++ b/dongle_infrastructure.c @@ -248,7 +248,6 @@ char *get_device_name(char *dir_name) struct directory *dr, *sub_dr; struct dirent *de; struct stat st; - int path_len; DIR *dir; dr = malloc(sizeof(struct directory)); @@ -573,8 +572,6 @@ struct ubus_object *dongle_create_dynamic_object(struct device *dev_instance) goto fail_dev_instance; struct ubus_object *dynamic_dongle_object; - struct ubus_method *methods; - struct ubus_object_type *type; char dynamic_dongle_name[DYNAMIC_OBJ_NAME_SIZE]; //create dynmaic object name.. diff --git a/dongle_pin.c b/dongle_pin.c index 6fa757755753e2b9a05d1065508fadf1e506f598..e096ea77d6808889a9d3017db0bd412f5785fe60 100644 --- a/dongle_pin.c +++ b/dongle_pin.c @@ -386,9 +386,6 @@ int remaining_tries(struct ubus_context *ctx, struct ubus_object *obj, free(ip_addr); return print_to_ubus(response, ctx, req); -fail_input: - free(ip_addr); - return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: free(ip_addr); fail_strdup: diff --git a/libmobile_zte.c b/libmobile_zte.c index d9c353653eeb30985e7afe218f47dd2d71402c54..8ff52cb59f1fe56fd19c85c7e9cfe61b9b089f6c 100644 --- a/libmobile_zte.c +++ b/libmobile_zte.c @@ -89,7 +89,7 @@ static int apn_profile_idx(struct json_object *apn_profiles, char *name) json_object_object_foreach(apn_profiles, key, val) { struct json_object *profile_name_json; - char *profile_name; + const char *profile_name; json_object_object_get_ex(val, "profile_name", &profile_name_json); @@ -499,7 +499,7 @@ struct json_object *mobile_create_apn_profile(char *ip_addr, char *profile_name, { char query[1024] = {0}; - snprintf(query, 1023, "isTest=false&goformId=APN_PROC_EX&apn_action=save&apn_mode=manual&profile_name=%s&wan_dial=*99%23&apn_select=manual&pdp_type=%s&pdp_select=auto&pdp_addr=&index=%d&wan_apn=%s&ppp_auth_mode=none&ppp_username=&ppp_passwd=&dns_mode=auto&prefer_dns_manual=&standby_dns_manual=", profile_name, pdp_type, get_apn_profiles_len(ip_addr), wan_apn); + snprintf(query, 1023, "isTest=false&goformId=APN_PROC_EX&apn_action=save&apn_mode=manual&profile_name=%s&wan_dial=*99%%23&apn_select=manual&pdp_type=%s&pdp_select=auto&pdp_addr=&index=%d&wan_apn=%s&ppp_auth_mode=none&ppp_username=&ppp_passwd=&dns_mode=auto&prefer_dns_manual=&standby_dns_manual=", profile_name, pdp_type, get_apn_profiles_len(ip_addr), wan_apn); return prepare_request(ip_addr, query, POST); }