}
}
if (msg->payload.userState->has_plugin_context) {
- if (client->context)
- free(client->context);
+ free(client->context);
client->context = Memory_safeMalloc(1, msg->payload.userState->plugin_context.len);
memcpy(client->context, msg->payload.userState->plugin_context.data,
msg->payload.userState->plugin_context.len);
Log_debug("Client version 0x%x", client->version);
}
if (msg->payload.version->release) {
- if (client->release) free(client->release);
+ free(client->release);
client->release = strdup(msg->payload.version->release);
Log_debug("Client release %s", client->release);
}
if (msg->payload.version->os) {
- if (client->os) free(client->os);
+ free(client->os);
client->os = strdup(msg->payload.version->os);
Log_debug("Client OS %s", client->os);
}
if (msg->payload.version->os_version) {
- if (client->os_version) free(client->os_version);
+ free(client->os_version);
client->os_version = strdup(msg->payload.version->os_version);
Log_debug("Client OS version %s", client->os_version);
}
if (msg->unpacked)
mumble_proto__version__free_unpacked(msg->payload.version, NULL);
else {
- if (msg->payload.version->release)
- free(msg->payload.version->release);
- if (msg->payload.version->os)
- free(msg->payload.version->os);
- if (msg->payload.version->os_version)
- free(msg->payload.version->os_version);
+ free(msg->payload.version->release);
+ free(msg->payload.version->os);
+ free(msg->payload.version->os_version);
free(msg->payload.version);
}
break;
if (msg->unpacked)
mumble_proto__text_message__free_unpacked(msg->payload.textMessage, NULL);
else {
- if (msg->payload.textMessage->message)
- free(msg->payload.textMessage->message);
- if (msg->payload.textMessage->session)
- free(msg->payload.textMessage->session);
- if (msg->payload.textMessage->channel_id)
- free(msg->payload.textMessage->channel_id);
- if (msg->payload.textMessage->tree_id)
- free(msg->payload.textMessage->tree_id);
+ free(msg->payload.textMessage->message);
+ free(msg->payload.textMessage->session);
+ free(msg->payload.textMessage->channel_id);
+ free(msg->payload.textMessage->tree_id);
free(msg->payload.textMessage);
}
break;
if (msg->unpacked)
mumble_proto__channel_state__free_unpacked(msg->payload.channelState, NULL);
else {
- if (msg->payload.channelState->name)
- free(msg->payload.channelState->name);
- if (msg->payload.channelState->description)
- free(msg->payload.channelState->description);
- if (msg->payload.channelState->links)
- free(msg->payload.channelState->links);
+ free(msg->payload.channelState->name);
+ free(msg->payload.channelState->description);
+ free(msg->payload.channelState->links);
free(msg->payload.channelState);
}
break;
if (msg->unpacked)
mumble_proto__user_stats__free_unpacked(msg->payload.userStats, NULL);
else {
- if (msg->payload.userStats->from_client)
- free(msg->payload.userStats->from_client);
- if (msg->payload.userStats->from_server)
- free(msg->payload.userStats->from_server);
+ free(msg->payload.userStats->from_client);
+ free(msg->payload.userStats->from_server);
if (msg->payload.userStats->version) {
- if (msg->payload.userStats->version->release)
- free(msg->payload.userStats->version->release);
- if (msg->payload.userStats->version->os)
- free(msg->payload.userStats->version->os);
- if (msg->payload.userStats->version->os_version)
- free(msg->payload.userStats->version->os_version);
-
+ free(msg->payload.userStats->version->release);
+ free(msg->payload.userStats->version->os);
+ free(msg->payload.userStats->version->os_version);
free(msg->payload.userStats->version);
}
- if (msg->payload.userStats->celt_versions)
- free(msg->payload.userStats->celt_versions);
+ free(msg->payload.userStats->celt_versions);
if (msg->payload.userStats->certificates) {
- if (msg->payload.userStats->certificates->data)
- free(msg->payload.userStats->certificates->data);
+ free(msg->payload.userStats->certificates->data);
free(msg->payload.userStats->certificates);
}
- if (msg->payload.userStats->address.data)
- free(msg->payload.userStats->address.data);
+ free(msg->payload.userStats->address.data);
free(msg->payload.userStats);
}