festival: fix fd leak
Coverity 1139831
diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c
index 42c78d0..7c4b88f 100644
--- a/gst/festival/gstfestival.c
+++ b/gst/festival/gstfestival.c
@@ -358,6 +358,7 @@
serverhost = gethostbyname (host);
if (serverhost == (struct hostent *) 0) {
fprintf (stderr, "festival_client: gethostbyname failed\n");
+ close (fd);
return -1;
}
memmove (&serv_addr.sin_addr, serverhost->h_addr, serverhost->h_length);
@@ -367,6 +368,7 @@
if (connect (fd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) != 0) {
fprintf (stderr, "festival_client: connect to server failed\n");
+ close (fd);
return -1;
}