From cf3e10adc6ba5f6b6a7a662ac2ffe27228c129c4 Mon Sep 17 00:00:00 2001 From: Bernhard Walle Date: Fri, 4 Feb 2005 18:14:41 +0000 Subject: [PATCH] Close the socket (Old svn revision: 340) --- panel-plugin/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panel-plugin/net.c b/panel-plugin/net.c index 6976785..e341f3e 100644 --- a/panel-plugin/net.c +++ b/panel-plugin/net.c @@ -1,5 +1,5 @@ /* - * Id: $Id: net.c,v 1.7 2005/02/04 18:12:01 bwalle Exp $ + * Id: $Id: net.c,v 1.8 2005/02/04 18:14:41 bwalle Exp $ * ------------------------------------------------------------------------------------------------- * * This program is free software; you can redistribute it and/or modify it under the terms of the @@ -191,9 +191,11 @@ char* get_ip_address(netdata* data) snprintf(ifr.ifr_name, IF_NAMESIZE, data->ifdata.if_name); if (ioctl(sockfd, SIOCGIFADDR, &ifr) != 0) { + close(sockfd); perror("Error in ictl(sockfd)"); return NULL; } + close(sockfd); p_sa = (struct sockaddr_in*) &ifr.ifr_addr;