[sr-dev] git:4.2:e759e5c8: core: init vars for socket ttl helper function to avoid warnings

Daniel-Constantin Mierla miconda at gmail.com
Tue May 19 09:32:22 CEST 2015


Module: kamailio
Branch: 4.2
Commit: e759e5c8998958eca61b317135be0acb3088fac0
URL: https://github.com/kamailio/kamailio/commit/e759e5c8998958eca61b317135be0acb3088fac0

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-05-19T09:28:46+02:00

core: init vars for socket ttl helper function to avoid warnings

(cherry picked from commit 23b476ed7c7b48ddd7cacf3d88e9c104db06d5dc)

---

Modified: sock_ut.c

---

Diff:  https://github.com/kamailio/kamailio/commit/e759e5c8998958eca61b317135be0acb3088fac0.diff
Patch: https://github.com/kamailio/kamailio/commit/e759e5c8998958eca61b317135be0acb3088fac0.patch

---

diff --git a/sock_ut.c b/sock_ut.c
index 3aee2cd..da46750 100644
--- a/sock_ut.c
+++ b/sock_ut.c
@@ -41,8 +41,8 @@
  */
 int sock_get_ttl(int sock)
 {
-	int ioptval;
-	unsigned int ioptvallen;
+	int ioptval = 0;
+	unsigned int ioptvallen = 0;
 
 	ioptvallen=sizeof(ioptval);
 	if (getsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
@@ -60,7 +60,7 @@ int sock_get_ttl(int sock)
  */
 int sock_set_ttl(int sock, int ttl)
 {
-	int ioptval;
+	int ioptval = 0;
 
 	if (setsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
 					sizeof(ioptval)) == -1 )




More information about the sr-dev mailing list