Skip to content

Commit

Permalink
Check if std.properties has been freed
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdm committed Oct 22, 2013
1 parent f616060 commit 6413fe4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,12 @@ static void mosquitto_client_object_destroy(void *object TSRMLS_DC)
/* We must loop here so that the disconnect packet is sent and acknowledged */
mosquitto_disconnect(client->client);
mosquitto_loop(client->client, 100, 1);

zend_hash_destroy(client->std.properties);
FREE_HASHTABLE(client->std.properties);
mosquitto_destroy(client->client);

if (client->std.properties) {
zend_hash_destroy(client->std.properties);
FREE_HASHTABLE(client->std.properties);
}
efree(object);
}

Expand Down

0 comments on commit 6413fe4

Please sign in to comment.