[PATCH ocserv 1/3] Add default case for 'restrict-user-to-ports' switch

Kevin Cernekee cernekee at gmail.com
Sun Jan 24 13:11:38 PST 2016


This fixes a compiler warning:

      CC       main-user.o
    main-user.c: In function ‘call_script’:
    main-user.c:215:7: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        if (ret < 0) {
           ^
    main-user.c:66:6: note: ‘ret’ was declared here
      int ret;
          ^

It's not really necessary because proto gets checked when the option is
parsed, but gcc doesn't know that.
---
 src/main-user.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/main-user.c b/src/main-user.c
index 0b054c8dba0e..dec840126471 100644
--- a/src/main-user.c
+++ b/src/main-user.c
@@ -210,6 +210,8 @@ static void export_fw_info(main_server_st *s, struct proc_st* proc)
 				case PROTO_ICMPv6:
 					ret = str_append_printf(&str_common, "icmpv6 all ");
 					break;
+				default:
+					ret = -1;
 			}
 
 			if (ret < 0) {
-- 
2.7.0




More information about the openconnect-devel mailing list