uclient-http: Close ustream file handle only if allocated
authorTobias Schramm <tobleminer@gmail.com>
Fri, 3 Aug 2018 21:39:21 +0000 (23:39 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 3 Aug 2018 21:46:06 +0000 (23:46 +0200)
commitae1c656ff041c6f1ccb37b070fa261e0d71f2b12
treec4a6d68d9d5ce036d876376509076299e1e21e02
parenteb850df45758be784b67b63dcbe31bd331c12483
uclient-http: Close ustream file handle only if allocated

Since the connection setup in uclient_do_connect can fail before
ustream_init_fd is called we must check the fd was actually allocated
before closing it, else we would close STDIN.

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
uclient-http.c