Resolve possible null pointer dereference

[channels/urbdrc/client/isoch_queue.c:124] -> [channels/urbdrc/client/isoch_queue.c:126]: (warning) Either the condition 'if(isoch)' is redundant or there is possible null pointer dereference: isoch.
This commit is contained in:
Ilya Shipitsin 2017-01-31 15:59:25 +05:00
parent 0a3bd2af4d
commit efaf1819ea

View File

@ -120,11 +120,13 @@ static int isoch_queue_unregister_data(ISOCH_CALLBACK_QUEUE* queue, ISOCH_CALLBA
}
queue->isoch_num--;
/* free data info */
isoch->out_data = NULL;
if (isoch)
{
/* free data info */
isoch->out_data = NULL;
zfree(isoch);
}
return 1; /* unregistration successful */
}