command: Fix possible null dereference in rarch_cmd_free

Free called on null pointers is OK, but if it's ever null and it hits this conditional, it will be a null pointer dereference.
This commit is contained in:
Lioncash 2014-09-12 08:07:38 -04:00
parent 7fc59210b1
commit a300ce5b2e

View File

@ -161,7 +161,7 @@ error:
void rarch_cmd_free(rarch_cmd_t *handle)
{
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
if (handle->net_fd >= 0)
if (handle && handle->net_fd >= 0)
close(handle->net_fd);
#endif