Changeset: 10f878ab2915 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=10f878ab2915
Modified Files:
        clients/mapilib/mapi.c
Branch: Jul2012
Log Message:

Fix resource leak.
Found by Coverity.
We don't need to create a socket right after we've successfully
created a socket of the same type that we then don't use.


diffs (11 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -2284,7 +2284,6 @@ connect_to_server(Mapi mid)
                userver.sun_family = AF_UNIX;
                strncpy(userver.sun_path, mid->hostname, 
sizeof(userver.sun_path) - 1);
                userver.sun_path[sizeof(userver.sun_path) - 1] = 0;
-               s = socket(PF_UNIX, SOCK_STREAM, 0);
 
                if (connect(s, serv, sizeof(struct sockaddr_un)) < 0) {
                        closesocket(s);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to