From 68821da01eb6edc1b525b0582bf70c38ca875341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 16 Sep 2013 12:34:33 +0200 Subject: [PATCH] Fix clang warnings in applications Some fd would be used uninitialized if we goto exit early. --- programs/ssl/ssl_client1.c | 2 +- programs/ssl/ssl_fork_server.c | 2 +- programs/test/ssl_test.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/ssl/ssl_client1.c b/programs/ssl/ssl_client1.c index d6e712bba..e09ad8ce5 100644 --- a/programs/ssl/ssl_client1.c +++ b/programs/ssl/ssl_client1.c @@ -74,7 +74,7 @@ static void my_debug( void *ctx, int level, const char *str ) int main( int argc, char *argv[] ) { - int ret, len, server_fd; + int ret, len, server_fd = -1; unsigned char buf[1024]; const char *pers = "ssl_client1"; diff --git a/programs/ssl/ssl_fork_server.c b/programs/ssl/ssl_fork_server.c index 3b24b31d4..e11611905 100644 --- a/programs/ssl/ssl_fork_server.c +++ b/programs/ssl/ssl_fork_server.c @@ -96,7 +96,7 @@ int main( int argc, char *argv[] ) { int ret, len, cnt = 0, pid; int listen_fd; - int client_fd; + int client_fd = -1; unsigned char buf[1024]; const char *pers = "ssl_fork_server"; diff --git a/programs/test/ssl_test.c b/programs/test/ssl_test.c index c8461dcdd..9c0075f5c 100644 --- a/programs/test/ssl_test.c +++ b/programs/test/ssl_test.c @@ -143,7 +143,7 @@ static void my_debug( void *ctx, int level, const char *str ) static int ssl_test( struct options *opt ) { int ret, i; - int client_fd; + int client_fd = -1; int bytes_to_read; int bytes_to_write; int offset_to_read = 0;