Do not call free handler for client if init does not complete.

This commit is contained in:
Michael Jumper 2011-11-26 14:50:03 -08:00
parent 61579bd9b7
commit 989f24be2b
2 changed files with 4 additions and 1 deletions

View File

@ -287,6 +287,9 @@ struct guac_client {
* by the proxy, and any data allocated by the proxy client should be * by the proxy, and any data allocated by the proxy client should be
* freed. * freed.
* *
* Note that this handler will NOT be called if the client's
* guac_client_init() function fails.
*
* Implement this handler if you store data inside the client. * Implement this handler if you store data inside the client.
* *
* Example: * Example:

View File

@ -210,7 +210,7 @@ guac_client* guac_client_plugin_get_client(guac_client_plugin* plugin,
client->__next_buffer_index = -1; client->__next_buffer_index = -1;
if (plugin->init_handler(client, argc, argv) != 0) { if (plugin->init_handler(client, argc, argv) != 0) {
guac_client_free(client); free(client);
return NULL; return NULL;
} }