[Asterisk-code-review] res_geolocation: Fix issues exposed by compiling with -O2 (asterisk[16])

Friendly Automation asteriskteam at digium.com
Fri Sep 16 12:58:39 CDT 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19265 )

Change subject: res_geolocation: Fix issues exposed by compiling with -O2
......................................................................

res_geolocation: Fix issues exposed by compiling with -O2

Fixed "may be used uninitialized" errors in geoloc_config.c.

ASTERISK-30234

Change-Id: I1ea336bf7abbc16fa59b75720f0db8f1d960b3d4
---
M res/res_geolocation/geoloc_config.c
1 file changed, 14 insertions(+), 1 deletion(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  Michael Bradeen: Looks good to me, approved
  Friendly Automation: Approved for Submit




diff --git a/res/res_geolocation/geoloc_config.c b/res/res_geolocation/geoloc_config.c
index dea7a22..26dd2d9 100644
--- a/res/res_geolocation/geoloc_config.c
+++ b/res/res_geolocation/geoloc_config.c
@@ -187,7 +187,7 @@
 	struct ast_geoloc_location *location;
 	const char *id = ast_sorcery_object_get_id(profile);
 	enum ast_geoloc_validate_result result;
-	enum ast_geoloc_format format;
+	enum ast_geoloc_format format = AST_GEOLOC_FORMAT_NONE;
 	int rc = 0;
 
 	if (!ast_strlen_zero(profile->location_reference)) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19265
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I1ea336bf7abbc16fa59b75720f0db8f1d960b3d4
Gerrit-Change-Number: 19265
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220916/70dd06de/attachment.html>


More information about the asterisk-code-review mailing list