Martin Ettl <ettl DOT martin AT gmx DOT de>: Fix various resource and memory leaks
[reactos.git] / reactos / base / applications / tsclient / rdesktop / rdesktop.c
index 5cf2900..37e5f38 100644 (file)
@@ -13,9 +13,9 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation, Inc.,
+   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
 #include <stdarg.h>            /* va_list va_start va_end */
@@ -1405,7 +1405,10 @@ load_licence(RDPCLIENT * This, unsigned char **data)
                return -1;
 
        if (fstat(fd, &st))
+       {
+               close(fd);
                return -1;
+       }
 
        *data = (uint8 *) xmalloc(st.st_size);
        length = read(fd, *data, st.st_size);