core: use g_clear_pointer() to avoid explicitly checking and resetting pointers
This commit is contained in:
committed by
Aleksander Morgado
parent
7de6b6f2e1
commit
436f9ef7e6
+2
-8
@@ -939,10 +939,7 @@ sms_store_next_part (GTask *task)
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->msg_data) {
|
||||
g_free (ctx->msg_data);
|
||||
ctx->msg_data = NULL;
|
||||
}
|
||||
g_clear_pointer (&ctx->msg_data, g_free);
|
||||
|
||||
if (!sms_get_store_or_send_command ((MMSmsPart *)ctx->current->data,
|
||||
ctx->use_pdu_mode,
|
||||
@@ -1218,10 +1215,7 @@ sms_send_next_part (GTask *task)
|
||||
|
||||
/* Generic send */
|
||||
|
||||
if (ctx->msg_data) {
|
||||
g_free (ctx->msg_data);
|
||||
ctx->msg_data = NULL;
|
||||
}
|
||||
g_clear_pointer (&ctx->msg_data, g_free);
|
||||
|
||||
if (!sms_get_store_or_send_command ((MMSmsPart *)ctx->current->data,
|
||||
ctx->use_pdu_mode,
|
||||
|
||||
@@ -2421,14 +2421,8 @@ update_registration_info (MMBroadbandModemMbim *self,
|
||||
self->priv->current_operator_name = operator_name_take;
|
||||
}
|
||||
} else {
|
||||
if (self->priv->current_operator_id) {
|
||||
g_free (self->priv->current_operator_id);
|
||||
self->priv->current_operator_id = NULL;
|
||||
}
|
||||
if (self->priv->current_operator_name) {
|
||||
g_free (self->priv->current_operator_name);
|
||||
self->priv->current_operator_name = NULL;
|
||||
}
|
||||
g_clear_pointer (&self->priv->current_operator_id, g_free);
|
||||
g_clear_pointer (&self->priv->current_operator_name, g_free);
|
||||
g_free (operator_id_take);
|
||||
g_free (operator_name_take);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user