From e0094640650c1ef35703331001b97bca650cf756 Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakobols@kth.se>
Date: Fri, 18 May 2018 15:27:02 +0200
Subject: [PATCH] minor style and other fixes

---
 .gitignore       | 1 +
 dongle.c         | 2 +-
 dongle_network.c | 2 +-
 dongle_pin.c     | 2 +-
 libmobile.c      | 6 ++++--
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0c47a95..402732f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 *.o
 *.so
 .*
+dongle
 dongle_apn
 dongle_pin
 dongle_network
diff --git a/dongle.c b/dongle.c
index 6fc47a4..8e1fd59 100644
--- a/dongle.c
+++ b/dongle.c
@@ -25,4 +25,4 @@ int main(int argc, char **argv)
 	uloop_run();
 
 	return 0;
-}
\ No newline at end of file
+}
diff --git a/dongle_network.c b/dongle_network.c
index da9a944..5877c73 100644
--- a/dongle_network.c
+++ b/dongle_network.c
@@ -127,4 +127,4 @@ int expose_network_object(struct ubus_context *ctx)
 	}
 
 	return 0;
-}
\ No newline at end of file
+}
diff --git a/dongle_pin.c b/dongle_pin.c
index 6105794..8a1e6aa 100644
--- a/dongle_pin.c
+++ b/dongle_pin.c
@@ -346,4 +346,4 @@ int expose_pin_object(struct ubus_context *ctx)
 	}
 
 	return 0;
-}
\ No newline at end of file
+}
diff --git a/libmobile.c b/libmobile.c
index bb1be01..f6dceae 100644
--- a/libmobile.c
+++ b/libmobile.c
@@ -300,7 +300,8 @@ static struct json_object *prepare_request(char *query, int option)
 	else if (option == GET) {
 		query = get_query_wrapper(query);
 		rv = perform_get_request(curl, query, &str);
-	}
+	} else
+		goto fail_request;
 
 	if (rv) {
 		debug_print("error performing curl, %s\n", curl_easy_strerror(rv));
@@ -322,6 +323,7 @@ static struct json_object *prepare_request(char *query, int option)
 	return parsed_response;
 fail_json:
 fail_ptr:
+fail_request:
 	curl_cleaner(curl);
 fail_curl:
 	free(str.ptr);
@@ -455,7 +457,7 @@ struct json_object *mobile_get_current_apn(void)
 		current_profile = json_object_get(val);
 		break;
 	}
-	json_object_put_(idx_json);
+	json_object_put(idx_json);
 	json_object_put(apn_profiles);
 	return current_profile;
 fail_idx:
-- 
GitLab