diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-07-29 11:55:40 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-07-29 11:55:40 -0700 |
commit | 41d27344c3b489466632bd2f1314fd69ff0a363c (patch) | |
tree | 4fbb1e118593da7b78813fbd9184d9c7a0c450d6 /client/libacron/ids.c | |
parent | b897bfe9f99872c701924f3cce269e6a36ea5bb5 (diff) | |
download | acron-41d27344c3b489466632bd2f1314fd69ff0a363c.tar acron-41d27344c3b489466632bd2f1314fd69ff0a363c.tar.gz acron-41d27344c3b489466632bd2f1314fd69ff0a363c.tar.bz2 acron-41d27344c3b489466632bd2f1314fd69ff0a363c.zip |
fix(libacron): spec incompliance: player is optional in disconnect events
API:CHANGE
Diffstat (limited to 'client/libacron/ids.c')
-rw-r--r-- | client/libacron/ids.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/libacron/ids.c b/client/libacron/ids.c index 89fff9a..7af471d 100644 --- a/client/libacron/ids.c +++ b/client/libacron/ids.c @@ -20,8 +20,11 @@ int ac_object_free(ac_obj_t *obj) { } case AC_EVENT_PLAYER_DISCONNECT: { ac_event_player_disconnect_t *v = (ac_event_player_disconnect_t *) obj; - if (v->player.name) free(v->player.name); - if (v->player.uuid) free(v->player.uuid); + if (v->player) { + if (v->player->name) free(v->player->name); + if (v->player->uuid) free(v->player->uuid); + free(v->player); + } if (v->reason) free(v->reason); goto ok; } @@ -77,4 +80,4 @@ int ac_object_free(ac_obj_t *obj) { free(obj); return AC_E_OK; }; -}
\ No newline at end of file +} |