From patchwork Mon Feb 26 03:36:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571222 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E393EDDDC for ; Mon, 26 Feb 2024 03:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918649; cv=none; b=Z4AxDYAXqGgzRWLgvxMXZM5djzGR+Asi7Kle4VFX5x4csUda3+dwCBW3oe0Jg/7ABKMG7n2eGg7bzXY5TpUaHOzPAkwkZnpAnaNcqxKZr4zuzvtse/01Vnie8VQwLfqhXw6aq1xmuncOA99O2ftm9Iq51RBLbFQbwfNB+eMbSeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918649; c=relaxed/simple; bh=WapNS4+xuPys4Bl63wSXa6yWBikhNhDzjjeMvBni9xI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IlqZIv5u5Q2FkMHlEgEqIwngMnb6CW/zgeneLCvRZP+SmIwnpcNBqs0XZzOaUmaqaQEkGSIioFd4+XI/4wkby7xsleH5uybiWgSpbaQhd3ppr6TlJQJi2FPAy+XY1R6zrBgCiATgXMzpOUhtDP9Wo6gjlw+5rTw5W7C76BBXjkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hJ9le534; arc=none smtp.client-ip=209.85.167.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hJ9le534" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3c1a2f7e302so184833b6e.0 for ; Sun, 25 Feb 2024 19:37:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918647; x=1709523447; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bKGaAc0B5QiXt+u4H5YuFCzcOehw4LaF83wwuGOJVHA=; b=hJ9le5340SLhahAlG9enMv4vdSTAVF5ZrnEIJl562zjR2tlUqqb5eTYA9CK+w8H1Wv JI7N2W/5xE6TOZiFDt/qTtbgdRFebDWNJ6JmJxsTibXc7NZbaQqbUwHPAUAmW7ZJcXqT omyhPBkLGaApJkFf5INOpHrXcqt7OStuHKKpiUZWpFBpmpPYSHvZftmFnU9W4MiIk1iz luyLByrDVHs3hwW8tsGOaJaMZSXqo2UxoU2qEGP3ktcLk4qYaDX6rfpAcjl4W67M+043 opx6sOYyBreG9C2XPpUs6NSCh52fPrQE3WndK92KAcHZjUW6XPNgZNwNKS70rFyCN+Py puHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918647; x=1709523447; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bKGaAc0B5QiXt+u4H5YuFCzcOehw4LaF83wwuGOJVHA=; b=cMQBimE6WVltSqmN8wpLKfqM0/+5M6z24/dHpwN7cG5c4GySQcaTbDntL5N2Yqz9bD QYIr/Mjq5tYAb9zRxJVJH006gBHUkKSWseWAdMDgI/9tZmcTlampE+7Fc/NDoYG7A8Fy Wwgv37LSOBygnUL/BjSrREUFKEL+eyaJUEpvlFIYL5Bs1qo709r/zNrXgN7WRZO58GpL pRcfKG+9BCmJnXPjt2S2L5K1RRzjpb5og271BRHGP4MKc94TrD04iCHrDQ/6M1i0gmOx huRx0tjPgZxSeF0HM7QB7BwNXUQKL5NHIDatsBL1rzFPS9wWs/6YCqDrADYL6vlj4pGj wvCQ== X-Gm-Message-State: AOJu0Yzqy3VtJEKnuOcYOv+UYQ3uABwhlm5Wg5PQ08SWgqK/MeYofBW2 yrXhO/fFiHP0fYUOBR/AGwVy0yctCk2Bg7OvCoLdjQBtH/9Ww0QCL8lMXWQT X-Google-Smtp-Source: AGHT+IHKV+mL16pfGjaMJhFspFI2faEtIYlS6pTml0g4mCSLkdxltUSyllwdF+gAaTA3zcJCQJgBsQ== X-Received: by 2002:a05:6808:2085:b0:3c1:51c1:f4ee with SMTP id s5-20020a056808208500b003c151c1f4eemr7694631oiw.48.1708918646815; Sun, 25 Feb 2024 19:37:26 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:26 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 01/22] gprs: Remove g_strfreev and g_strdupv use Date: Sun, 25 Feb 2024 21:36:44 -0600 Message-ID: <20240226033724.1460079-1-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by l_strfreev and l_strv_copy --- src/gprs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index dbf9b0605b7c..67f0d7803525 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -328,7 +328,7 @@ static void context_settings_free(struct context_settings *settings) g_free(settings->ipv4->ip); g_free(settings->ipv4->netmask); g_free(settings->ipv4->gateway); - g_strfreev(settings->ipv4->dns); + l_strfreev(settings->ipv4->dns); g_free(settings->ipv4->proxy); g_free(settings->ipv4); @@ -338,7 +338,7 @@ static void context_settings_free(struct context_settings *settings) if (settings->ipv6) { g_free(settings->ipv6->ip); g_free(settings->ipv6->gateway); - g_strfreev(settings->ipv6->dns); + l_strfreev(settings->ipv6->dns); g_free(settings->ipv6); settings->ipv6 = NULL; @@ -2940,8 +2940,8 @@ void ofono_gprs_context_set_ipv4_dns_servers(struct ofono_gprs_context *gc, if (settings->ipv4 == NULL) return; - g_strfreev(settings->ipv4->dns); - settings->ipv4->dns = g_strdupv((char **) dns); + l_strfreev(settings->ipv4->dns); + settings->ipv4->dns = l_strv_copy((char **) dns); } void ofono_gprs_context_set_ipv6_address(struct ofono_gprs_context *gc, @@ -2987,8 +2987,8 @@ void ofono_gprs_context_set_ipv6_dns_servers(struct ofono_gprs_context *gc, if (settings->ipv6 == NULL) return; - g_strfreev(settings->ipv6->dns); - settings->ipv6->dns = g_strdupv((char **) dns); + l_strfreev(settings->ipv6->dns); + settings->ipv6->dns = l_strv_copy((char **) dns); } static void free_contexts(struct ofono_gprs *gprs) From patchwork Mon Feb 26 03:36:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571223 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D132FC01 for ; Mon, 26 Feb 2024 03:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918649; cv=none; b=BwIAiC2AX6wCWn7l40zKwOSFaSrVJ3pnWsw1A16aGIkvUeCAhm8KcBhp5b/2vx98EJMRgZaTAb1CKe0t9RoUIRRTOt/JcVUBM8O2fRP2roLxscmM4o9IwwE12CT7vWsS2/kpWzrSNvGlUvt1ZTu4TpE2PX4j86S2Ic7n08eONdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918649; c=relaxed/simple; bh=AVuma3fFWaOLDJ4xTdHvaTeX4kveS6whblaBfq+5HRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dp+393BPfe54VlbQXAj5IR1RWWzVnvAztUthbaozrfaedit/wgUZYo0fHr/QNorzRqA6Ywl1OqILp7GHpOmp663YUUDlRRi2s4ystllXZ5byT1ZeSndWIyB8J7MqUs6OO32wnJtDrUicNaVcXIfFVnaVlG8e7ymyZzBFMc2u04I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HLb+9vy+; arc=none smtp.client-ip=209.85.167.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HLb+9vy+" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3bd4e6a7cb0so2030164b6e.3 for ; Sun, 25 Feb 2024 19:37:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918647; x=1709523447; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H+fiC/+wpjR+AW48KaeKiIJINjclJgupQgWZPNZrqzA=; b=HLb+9vy+GfvUT+CmvYY+mGNPJ5b4DcH9wEFgM0wR3I7qtynxy3OgdZr9udPdQF49Ao UCm6mS0TWy7ZJA7ERBSJK8hv3wo4CA51IsTAD+P1aAFl3ImVfHY0JEFQNdyyKAV8Z0aA NiyLNyc5ke0U0IQDJNjLZA7wHnya7osy8GvJbuNHHUC+MIH/rRnd51j2cTQTJSupXNKb TJt60x3i8VPvMR5IzbiG5pTq/udETahR0l8AyiTGwfQ3vTliMZebb8Y1iNfInsyKaNjz HRCBm5h4xXhku6gg6I3kQ2PHMkOgV+3XvvKwVB/PVat93/V8QY6oT0ArBVu7xEyKBUTN z+Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918647; x=1709523447; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H+fiC/+wpjR+AW48KaeKiIJINjclJgupQgWZPNZrqzA=; b=msgSqE2GuTbtL8rSbhYA7MunEqYFHAaDNvLLhe/4EBHlo2/SMqFAUt63EvYyNcxQHB UzloKFU/9alg24qmJjVYhhgf6XvY5kQ25LSt0A64ZWwoaDZxkvRV0oEdJiBoqLvejFnL uqH5o+EB1d5SNQKzIQUYL0fuVh7tIhAxPtjGrSSLo4edxGnxXfQzD0EAIfGKJal6ud45 MgOBXKZSn+LuujUdT4zvSzS7aYzB11/LQ+T7qTILRgffR6yKh1+WBLPCWtjMRdqSOQd6 qrMsQAem0SWls/0o2Wg8d/AtsgUdy/8Gg/GNROAstvAnBAPM4ll4SLSuMqfpzIOU8f9q aESw== X-Gm-Message-State: AOJu0YzyeEYw3pYOpmBCQfBtVUPr5f/1Km3hb9nIBIQOGKPefw69hr5+ hD7BpDrMdWve1dj42EsUlgiXLmkqdw7pAdhhCcpb6AM+EduEPVL4UH+AKdHu X-Google-Smtp-Source: AGHT+IFdjfZNq4wzDd7n7HsQ9LlPKKhz741LNVEcrtrQ/zwGEPc4rOHTB7QSqtmrjQWomn375ZAFxQ== X-Received: by 2002:a05:6808:1403:b0:3c1:4e89:f119 with SMTP id w3-20020a056808140300b003c14e89f119mr7653576oiv.0.1708918647461; Sun, 25 Feb 2024 19:37:27 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:27 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 02/22] network: Remove g_strfreev use Date: Sun, 25 Feb 2024 21:36:45 -0600 Message-ID: <20240226033724.1460079-2-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by l_strfreev --- src/network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network.c b/src/network.c index 17cff7837a69..347861046e1a 100644 --- a/src/network.c +++ b/src/network.c @@ -127,14 +127,14 @@ static char **network_operator_technologies(struct network_operator_data *opd) ntechs += 1; } - techs = g_new0(char *, ntechs + 1); + techs = l_new(char *, ntechs + 1); ntechs = 0; for (i = 0; i < sizeof(opd->techs) * 8; i++) { if (!(opd->techs & (1 << i))) continue; - techs[ntechs++] = g_strdup(registration_tech_to_string(i)); + techs[ntechs++] = l_strdup(registration_tech_to_string(i)); } return techs; @@ -345,7 +345,7 @@ static void set_network_operator_techs(struct network_operator_data *opd, OFONO_NETWORK_REGISTRATION_INTERFACE, "Technologies", DBUS_TYPE_STRING, &technologies); - g_strfreev(technologies); + l_strfreev(technologies); } static char *get_operator_display_name(struct ofono_netreg *netreg) @@ -553,7 +553,7 @@ static void append_operator_properties(struct network_operator_data *opd, DBUS_TYPE_STRING, &technologies); - g_strfreev(technologies); + l_strfreev(technologies); } if (opd->eons_info && opd->eons_info->info) { From patchwork Mon Feb 26 03:36:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571224 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2564214008 for ; Mon, 26 Feb 2024 03:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918650; cv=none; b=eZCIToXicWEa1wPklwL1cKjczibuq6iJPNvYFTgF/IO3ZN26d8a41LzFvROvDzVwf7luYMYrVH8wuK28NWA70jCQjyxwFUtOA9rqXdOvx1WeKaedKhYPYP69HwEXRi/yGkbjBFu2XmjX/UwWS8G4CAc+rTJCzlGr0/9ee1oK8Xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918650; c=relaxed/simple; bh=6xZCzY3CewCh/vkOP/1wkDv7eqzRGUjVIdMHxqFMQZg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lpFMKrp8ociRmsTIsMbkkzDYL11A4GtY26UNXMCLV8vWD7ilouAcRhMrmQMs0L1vt5pHWDznTGEXUTGKB6IadMtgz/qKn81ZHN+/cbMC4CsmlgeJSjSYIbWCo3KPzRC3FwzGqOJDR6u5BUOssaS3PmklwgYjXJKhrNEX7+wSSDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Hd6X6pXf; arc=none smtp.client-ip=209.85.167.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hd6X6pXf" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3c19937913fso1002856b6e.3 for ; Sun, 25 Feb 2024 19:37:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918648; x=1709523448; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1QH1gZeISFilH0DtE1rQTW1HUzoFcM97AVNQNNHunA8=; b=Hd6X6pXfxyHt3z8Qackvot5LdLetAgV/uUzrBclqK9s3qNTy3B0EBb0cryZ0hJuDNI u/tvqr5OcZtsGWar6loZTDh4ewoRDwaD06YiYr7FwHv3nbOLUvPglvB+XTHic0IkadcG iY7E19swGkS2hvhSwnHyvgUSjDz/+slotwg6hUWeQ5D4eqG8v+uGSAIyjokLxxMXGNyg K81IsrNAATmSkDO+oF22aLGXKnE7QRxSN0E9oNrNyApip54hkizFh1FUG1LUtNBgDHj2 A3D6ArcKvAhBTlu8V9olC+vDb2RdaDrBc4Z8CRQV5jO5s9JOLO4yCy/TBlQJ78N8TIMd J07Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918648; x=1709523448; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1QH1gZeISFilH0DtE1rQTW1HUzoFcM97AVNQNNHunA8=; b=oUQatf7+dr+mJin5iE+c3dHnKXDo50dyoUV3W/Gz9hG+S1KkLXdYvDNnLuEAzKuL63 rFyN4mlAVx0prJv10blRoyBabru0SZaNG80Ubo7izcKOKb1pUg1DXeTPVtLCCP96+jnh MS6NuswXhbEFOi9K7ETUdMCdKR50yaoazhYLsKsk2AlPlBNZHN/k6p8GsPB59mMQnFGf k0mzLkqz2jCjZejOmtG48UrQKHiVVIvewYN2GtHVLXs8qsqwaDnguZsvQC3THU/E2eQO 2RBpVfwaBRICK733EBuXs0D/xhL6XvMJb6jt8gmgP+UMJe9nW39j9lHunVJQ16eIYVVj WFvA== X-Gm-Message-State: AOJu0YxS6aluA124oHxUQ9GOKgEcin2pstn+LrbY5Fudm+/InNKPUZLB RFOp8ypYeXBd4A+OqisANUjjQCrusmRsnr0M15VQnlWDwLMsDR179waSJsl/ X-Google-Smtp-Source: AGHT+IEidjHXxQtUf8KZuTn7GaFM1xCoroL7fxo73RxwbDjfIiIARDD7/WYLjcHPEIG452Sv1BFNlw== X-Received: by 2002:a05:6808:278c:b0:3c1:3a0c:c1c8 with SMTP id es12-20020a056808278c00b003c13a0cc1c8mr6341192oib.51.1708918648072; Sun, 25 Feb 2024 19:37:28 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:27 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 03/22] sim: Remove g_strfreev use Date: Sun, 25 Feb 2024 21:36:46 -0600 Message-ID: <20240226033724.1460079-3-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by l_strfreev --- src/sim.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/sim.c b/src/sim.c index 1873eccccf2e..db65d22f40fd 100644 --- a/src/sim.c +++ b/src/sim.c @@ -264,13 +264,13 @@ static char **get_own_numbers(GSList *own_numbers) if (own_numbers) nelem = g_slist_length(own_numbers); - ret = g_new0(char *, nelem + 1); + ret = l_new(char *, nelem + 1); nelem = 0; for (l = own_numbers; l; l = l->next) { num = l->data; - ret[nelem++] = g_strdup(phone_number_to_string(num)); + ret[nelem++] = l_strdup(phone_number_to_string(num)); } return ret; @@ -289,7 +289,7 @@ static char **get_locked_pins(struct ofono_sim *sim) nelem += 1; } - ret = g_new0(char *, nelem + 1); + ret = l_new(char *, nelem + 1); nelem = 0; @@ -297,7 +297,7 @@ static char **get_locked_pins(struct ofono_sim *sim) if (sim->locked_pins[i] == FALSE) continue; - ret[nelem] = g_strdup(sim_passwd_name(i)); + ret[nelem] = l_strdup(sim_passwd_name(i)); nelem += 1; } @@ -345,14 +345,14 @@ static char **get_service_numbers(GSList *service_numbers) nelem = g_slist_length(service_numbers) * 2; - ret = g_new0(char *, nelem + 1); + ret = l_new(char *, nelem + 1); nelem = 0; for (l = service_numbers; l; l = l->next) { num = l->data; - ret[nelem++] = g_strdup(num->id); - ret[nelem++] = g_strdup(phone_number_to_string(&num->ph)); + ret[nelem++] = l_strdup(num->id); + ret[nelem++] = l_strdup(phone_number_to_string(&num->ph)); } return ret; @@ -444,15 +444,14 @@ static DBusMessage *sim_get_properties(DBusConnection *conn, } own_numbers = get_own_numbers(sim->own_numbers); - ofono_dbus_dict_append_array(&dict, "SubscriberNumbers", DBUS_TYPE_STRING, &own_numbers); - g_strfreev(own_numbers); + l_strfreev(own_numbers); locked_pins = get_locked_pins(sim); ofono_dbus_dict_append_array(&dict, "LockedPins", DBUS_TYPE_STRING, &locked_pins); - g_strfreev(locked_pins); + l_strfreev(locked_pins); if (sim->service_numbers && sim->sdn_ready) { service_numbers = get_service_numbers(sim->service_numbers); @@ -460,7 +459,7 @@ static DBusMessage *sim_get_properties(DBusConnection *conn, ofono_dbus_dict_append_dict(&dict, "ServiceNumbers", DBUS_TYPE_STRING, &service_numbers); - g_strfreev(service_numbers); + l_strfreev(service_numbers); } if (sim->language_prefs) @@ -832,7 +831,7 @@ static void sim_locked_cb(struct ofono_sim *sim, gboolean locked) if (g_strcmp0(typestr, "pin") == 0) pin_cache_update(sim->iccid, pin); - g_strfreev(locked_pins); + l_strfreev(locked_pins); sim_pin_retries_check(sim); } @@ -1413,13 +1412,11 @@ check: sim->own_numbers = sim->new_numbers; own_numbers = get_own_numbers(sim->own_numbers); - ofono_dbus_signal_array_property_changed(conn, path, OFONO_SIM_MANAGER_INTERFACE, "SubscriberNumbers", DBUS_TYPE_STRING, &own_numbers); - - g_strfreev(own_numbers); + l_strfreev(own_numbers); } else { g_slist_free_full(sim->new_numbers, g_free); } @@ -1504,7 +1501,7 @@ check: "ServiceNumbers", DBUS_TYPE_STRING, &service_numbers); - g_strfreev(service_numbers); + l_strfreev(service_numbers); } } @@ -2328,7 +2325,7 @@ static void sim_efli_efpl_changed(int id, void *userdata) return; if (sim->language_prefs) { - g_strfreev(sim->language_prefs); + l_strfreev(sim->language_prefs); sim->language_prefs = NULL; } @@ -2604,7 +2601,7 @@ static void sim_free_early_state(struct ofono_sim *sim) } if (sim->language_prefs) { - g_strfreev(sim->language_prefs); + l_strfreev(sim->language_prefs); sim->language_prefs = NULL; } @@ -2764,7 +2761,7 @@ static void sim_set_locked_pin(struct ofono_sim *sim, OFONO_SIM_MANAGER_INTERFACE, "LockedPins", DBUS_TYPE_STRING, &locked_pins); - g_strfreev(locked_pins); + l_strfreev(locked_pins); } static void sim_query_fac_pinlock_cb(const struct ofono_error *error, @@ -3187,7 +3184,7 @@ static void sim_pin_query_cb(const struct ofono_error *error, "LockedPins", DBUS_TYPE_STRING, &locked_pins); - g_strfreev(locked_pins); + l_strfreev(locked_pins); } } From patchwork Mon Feb 26 03:36:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571225 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90ADCDDDC for ; Mon, 26 Feb 2024 03:37:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918651; cv=none; b=kScDW+vET1CZ+OPcLLLKv0L6KM0FR2quvCjEHhXWLyQvg24lujW0oEPoLnb7Z5fd1PLvfHS6JeHYGSKRZUOcnOpApZDarBaXWsUkbMSXf62n4qM6cc/Oj/FEyNN60/g22Au1aGhdJarMZSlulOVh40CkpP8IwarPTIzYFBpqIRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918651; c=relaxed/simple; bh=Yqg6kM9jR4uTfPXFa5wbUMQJuQmlI0viVhGWa228Coc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nn9dq80IZTjf0UjefbCmT7DW8IMyyFQldaAILrw7mbpGuHPrwO9HuaQs7xotNPMAre/EBcuSDTmCZoK8XFI8g7WgRXPodBLltcogae37fPe9KUBPC94Bz66vpm6fLOXKHFKCf9NGmxnWkk0S8CxoXjyJPkCxr0IVtNs6XoUONCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fYJt8BaX; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fYJt8BaX" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3bd72353d9fso1764544b6e.3 for ; Sun, 25 Feb 2024 19:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918648; x=1709523448; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZXVZJWfzInCZJjgsnorccpxG/jTaPR6G0g9QoTxxzi0=; b=fYJt8BaX5qcMsdExYks1d62/uKYCV0iAcGbGcfYHUnscRb7uZBtej1xNhjotCvn4nq WZmtQLaZymrkK2A+gh4aRULmyjQy5HpvTgVZ+nRRPF2oBAuGm1CkQOeepAWaHeDcgUtT LFUtnhN60WNCQ+c0bAPKjGQrZgtyYSEc4t6ttEAl728CpxpQJSHlUh8RutBIXAH7UD4E CJswia/lR5XeZSKJMlFcs2wLWBKGbz/r+J3IYMPrReJiQ3n87FA0E8587OpF4qARBn+R NoDyDu2XOZn4uS3eJBLEktXtgo3YCSz7LNdbHOhUGmTorz72io0TgZg+gdN7B8w4z37x 8l1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918648; x=1709523448; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZXVZJWfzInCZJjgsnorccpxG/jTaPR6G0g9QoTxxzi0=; b=wnYwQ18ETsesPd/I3zf2qhXRK1aChkCocz0l2ulXMU7xWIMHmjtagPGBgvAjWEr5h3 /GScZLZQdc208HPDb2fPsk2aYL8ZYhWQlYC7DfFjV12lZb88Ci45H0MQ/BScctvh95h7 he436/MakbrYERI9UBAO1ivgu7Zqs1sdf4GZfz6wKfcLmomSl76siad65EEC/dStJ2DQ 2KPUpomdCqnV6zn1GpEWHabrCHLwSnMJzp8gsS2LhXVZLGkTQr9rRHJU/TZhhB4dHi8+ H3HKTERUsHoZ/3rkYx4vXxssPi8KOO/vqz4YgVenEYd5OMfSHxcB91Oq3dBXtRobk+SX hhJw== X-Gm-Message-State: AOJu0Yy3okKdCFtf2HaRAmUWKtb/S6QwbZvFMXgFzZpITknt86AdFNfp XElaInJTYAkiGw+b+k77qgsbDT2KCjcAwte5eipRM0zEr2a2ORGmCuc/3hHs X-Google-Smtp-Source: AGHT+IFpJiSl920Sqrpe/kHW4Gxds5Y+tLSQbhxOIs1ODRtWZUhr6DXwoVSzrcOrbPlApmd1p/JF1Q== X-Received: by 2002:a05:6808:aa9:b0:3c1:66ec:5aa with SMTP id r9-20020a0568080aa900b003c166ec05aamr6687843oij.22.1708918648678; Sun, 25 Feb 2024 19:37:28 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:28 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 04/22] voicecall: Remove g_strfreev and g_strdupv use Date: Sun, 25 Feb 2024 21:36:47 -0600 Message-ID: <20240226033724.1460079-4-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by l_strfreev and l_strv_copy --- src/voicecall.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 6d677a9a7487..6882153aa671 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -1092,14 +1092,11 @@ static int voicecalls_path_list(struct ofono_voicecall *vc, GSList *call_list, int i; struct voicecall *v; - *objlist = g_new0(char *, g_slist_length(call_list) + 1); - - if (*objlist == NULL) - return -1; + *objlist = l_new(char *, g_slist_length(call_list) + 1); for (i = 0, l = call_list; l; l = l->next, i++) { v = l->data; - (*objlist)[i] = g_strdup(voicecall_build_path(vc, v->call)); + (*objlist)[i] = l_strdup(voicecall_build_path(vc, v->call)); } return 0; @@ -1926,7 +1923,7 @@ static void multiparty_callback_common(struct ofono_voicecall *vc, dbus_message_iter_close_container(&iter, &array_iter); - g_strfreev(objpath_list); + l_strfreev(objpath_list); } static void private_chat_callback(const struct ofono_error *error, void *data) @@ -2747,9 +2744,9 @@ check: void ofono_voicecall_en_list_notify(struct ofono_voicecall *vc, char **nw_en_list) { - g_strfreev(vc->nw_en_list); + l_strfreev(vc->nw_en_list); - vc->nw_en_list = g_strdupv(nw_en_list); + vc->nw_en_list = l_strv_copy(nw_en_list); set_new_ecc(vc); } @@ -2882,7 +2879,7 @@ static void voicecall_unregister(struct ofono_atom *atom) free_sim_ecc_numbers(vc, FALSE); if (vc->nw_en_list) { - g_strfreev(vc->nw_en_list); + l_strfreev(vc->nw_en_list); vc->nw_en_list = NULL; } From patchwork Mon Feb 26 03:36:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571226 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8515714A98 for ; Mon, 26 Feb 2024 03:37:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918652; cv=none; b=uywc+Bi722S7FdHieVfkwdC5AztUELggHa/99bSeTlgBmJh6v44y98e6YAgZGVdCcTK81/ZGpDjOs6767YWRMlpL9Gkwi5cO3NxbtOhN1G7/EWxj+GAEhO0Y0fU09BLr5PqjiWAc7p1CAdCAeb56RZJG0B4pCMvYQA8QhCw/uI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918652; c=relaxed/simple; bh=5jlb4cx3qFckg/BgWDhKh8kYCi/u1w+u2cmE6jQGUhs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rEL7quHNUrvSggzxXoeztb2Eg8smqCmwPRwt/VYhbcPD8swEgAg/ZsnhWQcprDMZSty7cuUytkcjEpx3zrtOqpcH+58jkDqqUNalME3X9DLy7VG1rPkTVBN+6FLLbb2D9TAmTjaeM32jFwuxCu2o2Nc0WS9AmRvZIH+eidToLOc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QkJS+S0u; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QkJS+S0u" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-6e0f43074edso1859641a34.1 for ; Sun, 25 Feb 2024 19:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918649; x=1709523449; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4vdD9yIKOL3TE8dSsdKe6lPckjCuUF3cIIacHEeqUIg=; b=QkJS+S0uBf/Z7rkCNQo+JPUPnr4AL+q5pDtgqEc2zmQZuz2FcG4tktiDJWqkJ+67Q9 K1mYesma4p6rtxOx/wdynbDTDOmOsJ0NWn/+JnRjKVf2nftVoY5uXi5p525iaEkwrLJj f0AO6ij5n/8nvhfAKavwg+6sMt0sgFJthifeEUrCId1S1IzymC3+Hoj54a9ttkqYXJEJ alZzm3XHnGqOIF+711fyzstiisdl7auKGAB2qPxfeY3+jzTvxJ/T+0W+pgDhwJBJPexE 0wCaQWpPLZt5bu7yRXZP8Mjen1HKDozYVEupfCmQie5K8qYD1qLX8WAZ14UMZQ5P6ycL 0j2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918649; x=1709523449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4vdD9yIKOL3TE8dSsdKe6lPckjCuUF3cIIacHEeqUIg=; b=WVImpDBanFEyLyltudGwC2Q9g4Ybw2GxpKEsXv4+TUJ5U7k6YDNNfMUPBqqsUHZii+ i10xZN7s9FlcQeO3ARcukBq78PpZlI1fintpPihmE3NucWJ9tI1L7zoyqtf5f28HRuXO k3hTjz/vrcoLQ2AYvEVIGww+adBaBRlMYgo2HzJwBl2D0nsFIge4WE4aL4UjWWDJw9UL Gx19jfUPWJtDWeAYGZSYjJQZwxpUzYXGM1UIod0DkWIwxVrg719MDSVCeMH8xlJ0eXlR hKthFsk14c7wPGThQOP5t0XT6EYErxST4gZ2Bvn1nuw0aHFjyuX+XVVkNguPfE45Ou4B +65Q== X-Gm-Message-State: AOJu0YzcBtW3DtWTVU2YgGOqRyse5HOlObmgd/LxqszjadsxMWwTRy/e bL9y1anGPAQx0Z73mvfy+uC4O+mYPpgKasuZpq0j1Up+R0YYJjNbDNV6tI7D X-Google-Smtp-Source: AGHT+IFveooqVlnqDIGMgvDJYc2ENwbp9SozRLbwKTzVpoBQF2MZ4eQerPW/liPHA03UGF4xahvnYg== X-Received: by 2002:a05:6808:188d:b0:3c1:5d8f:5234 with SMTP id bi13-20020a056808188d00b003c15d8f5234mr6600800oib.43.1708918649360; Sun, 25 Feb 2024 19:37:29 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:29 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 05/22] main: Remove g_printerr use Date: Sun, 25 Feb 2024 21:36:48 -0600 Message-ID: <20240226033724.1460079-5-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by fprintf(stderr, ...) --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 82157700b6ac..141853eef8ae 100644 --- a/src/main.c +++ b/src/main.c @@ -210,19 +210,19 @@ int main(int argc, char **argv) if (g_option_context_parse(context, &argc, &argv, &err) == FALSE) { if (err != NULL) { - g_printerr("%s\n", err->message); + fprintf(stderr, "%s\n", err->message); g_error_free(err); return 1; } - g_printerr("An unknown error occurred\n"); + fprintf(stderr, "An unknown error occurred\n"); return 1; } g_option_context_free(context); if (option_version == TRUE) { - printf("%s\n", VERSION); + fprintf(stdout, "%s\n", VERSION); exit(0); } From patchwork Mon Feb 26 03:36:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571227 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEF2D14008 for ; Mon, 26 Feb 2024 03:37:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918652; cv=none; b=Jyh39j/P9E8wjd7W3tJECT9Kw5gULTJqgKGemjOc5d8/GzeAQTjOzBsbgtHrp/l9R5gghKDPSUB/tZKJZ2+93m69qDsW/xHuVwf3oRlPubGqsKC8Y/rezkH7t9m0Shkp6NVDBFC2xTBR2p9Wy53I/qES8YUY9LwE9+5JI4OGimY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918652; c=relaxed/simple; bh=XfbBq4ogu2sbPA3Mhw8F4sg8oBYPKL1RxnOmDlT+yo0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eZoxWhZd/QME0UU3fXp+eaWZM/MIVyjIrOcYnm4rra3uEqf4yF+QNRYePhcg+uXQvt9XDmyiLIn3rsn9E1QPTxYaxpc+spNbMZl3JQdkU/DEuUo8lfS/s5YZCaBuE7hsJhyszSXvf9B/LH6HC1HN4kxLrPcw6iv0r297P8ApERM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Y8YVBrjv; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y8YVBrjv" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3bb9d54575cso2237829b6e.2 for ; Sun, 25 Feb 2024 19:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918650; x=1709523450; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EuZPdQ0vSqtzIJ9QYWHZgSsXjY8uGUzkPguuHwrq99k=; b=Y8YVBrjvsTeqOVdhMFeGjwi3Czq7Q7Zu+A/+DarmPZfRF7QRNcKrAJxITgvoTry+AN u46JIa4TKax9p2s4knfV5awXjp4ApHURpw9i/wixyKp1uzJCZvZc/7rW+M7ZRHm3vamH zH+Ms6eqxnD1VrhJPTbjwoPJU9r9LFut9tQGfGn85fiH2kkYi3zx7U3UEvi+ni0p3Fjg GTkTOZf1ZJOqek+bI56OTH/x3mwbX3Q8aqOLQfIGrM6MRcCEerUKeTlsfNgowZLFACCu 4JUpRw8+NnJZLhFvwg8qQfB5EwDfXFaQhhZhXxe2Qv80dl8QxMJVwDJ3rOsOQvYRRy2C qZAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918650; x=1709523450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EuZPdQ0vSqtzIJ9QYWHZgSsXjY8uGUzkPguuHwrq99k=; b=Ji39sQEBm9Eb+Pv3BmMgOoU8Zb7ZnPwqpF8j6iiU2I34ANIqRBvbJfERcQOrzi0cUu UvqAWcA02w20INJhd/BqO0AxLocmauBQUJCu3MgVcdUyC9DPEUKZ5wN/j9CL7S8o/bA+ 1/k6DtbCyURU+I8ifG1sbdweOOArx3+PI6ayUoQdzx41/ghiGWn/3WMdzYMF5Kx8ciSz JfeqDQ7CHOJrM++IG6bV/qsAc41/xUTn8j5usOJQA0upha1Hfhbgqs6tALVii4Tm3yQY 6C9/AiNLPAZXWnTRS/ePGiOepuQRVg1thxXASJsiCO81TCk1bnDc+42FW5mxZmmWFJkt HBrg== X-Gm-Message-State: AOJu0YxG0O+rrsADjHJPtiQJqwJisX/f80g8yAy6YwkQpaRdp0evx9h4 DGjXJK1LCkxgyLFO8sKkqEtEhz8bS6oYEaNxxD5sF1eeaIqLfoQOuX6Xtx8E X-Google-Smtp-Source: AGHT+IGQ34c/Hpb0VFjPJ/Vd7j1qdIOjoC9v025FCDbAAudOb/0NYyhlIHplZ3jIKW1+w7AhnLgnOQ== X-Received: by 2002:a05:6808:d49:b0:3c1:9caf:c0b2 with SMTP id w9-20020a0568080d4900b003c19cafc0b2mr3987834oik.7.1708918650047; Sun, 25 Feb 2024 19:37:30 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:29 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 06/22] ifxmodem: Remove g_strfreev use Date: Sun, 25 Feb 2024 21:36:49 -0600 Message-ID: <20240226033724.1460079-6-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by l_strfreev --- drivers/ifxmodem/voicecall.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c index b5e880ff4162..19304910db38 100644 --- a/drivers/ifxmodem/voicecall.c +++ b/drivers/ifxmodem/voicecall.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -797,7 +798,7 @@ static void xlema_notify(GAtResult *result, gpointer user_data) int index, total_cnt; const char *number; int len; - int count = (vd->en_list == NULL) ? 0 : g_strv_length(vd->en_list); + int count = l_strv_length(vd->en_list); g_at_result_iter_init(&iter, result); @@ -826,10 +827,10 @@ static void xlema_notify(GAtResult *result, gpointer user_data) goto done; if (vd->en_list == NULL) - vd->en_list = g_new0(char *, total_cnt + 1); + vd->en_list = l_new(char *, total_cnt + 1); len = strspn(number, "0123456789"); - vd->en_list[count] = g_strndup(number, len); + vd->en_list[count] = l_strndup(number, len); if (number[len] != '\0') ofono_warn("Malformed emergency number: %.*s", len, number); @@ -841,7 +842,7 @@ done: if (vd->en_list) { ofono_voicecall_en_list_notify(vc, vd->en_list); - g_strfreev(vd->en_list); + l_strfreev(vd->en_list); vd->en_list = NULL; } } @@ -866,7 +867,7 @@ static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data) while (g_at_result_iter_next(&iter, "+XLEMA:")) num += 1; - vd->en_list = g_new0(char *, num + 1); + vd->en_list = l_new(char *, num + 1); num = 0; g_at_result_iter_init(&iter, result); @@ -882,7 +883,7 @@ static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data) continue; len = strspn(number, "0123456789"); - vd->en_list[num++] = g_strndup(number, len); + vd->en_list[num++] = l_strndup(number, len); if (number[len] != '\0') ofono_warn("Malformed emergency number: %.*s", @@ -891,7 +892,7 @@ static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data) ofono_voicecall_en_list_notify(vc, vd->en_list); - g_strfreev(vd->en_list); + l_strfreev(vd->en_list); vd->en_list = NULL; } @@ -1011,7 +1012,7 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc) g_slist_free_full(vd->calls, g_free); - g_strfreev(vd->en_list); + l_strfreev(vd->en_list); ofono_voicecall_set_data(vc, NULL); From patchwork Mon Feb 26 03:36:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571228 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3205DDDC for ; Mon, 26 Feb 2024 03:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918653; cv=none; b=W9k1gikVpzSxRABpKAWZ6fqlvloOIFj8Mgu9wEZAqMAt/2mUupzYBnpD0VF+eVxRFF2wJ/isz8lGc+zhmJiRPMAuLqg+GNZfGDIV1diMiU5SvBRQCfhkmi3QDwENV/PM1au6ZOMcMniSGB7B4WfuyvI37fLiqP8bX4QVTaWOYuM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918653; c=relaxed/simple; bh=hqFVu02ic8R1trtME6BpjVbeNsXhZHGjMwsqKN2Dd8c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cLLXdJtfo4fla7MV/cg19vf3UF60av4VY0DkiXo84RC8gtH4pRUeDGEwBs4p/Ub7tcP0GxxPAzoA+7B/cElO8g0G4qu4BhLCEm88ZtW8dEMlWs7cqqGdpu7V5/UAmr18a/kuDJKO+b3B5PukNEene6MtObRUaMckhTE8/q1mm3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gs7kIAg0; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gs7kIAg0" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3bbd6ea06f5so1535496b6e.1 for ; Sun, 25 Feb 2024 19:37:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918650; x=1709523450; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J7dLHEfLQ42SROzcUDGEmQ80CzWJlvbdGfW9FhtTznU=; b=gs7kIAg0e5vuXh4iHQuxXPudCNVD0lWsAwiyB9B00AV+WhpkVTqjjexClauo/57l6e e6ydq2PsBfX7j4PBZLgj9jmmglO+zdLIh5q+fDnEhkWRFWdkn2UuOVOMEEzo87sGi0ri KMt+2/JfNh2lvjqnGNsqHsbtqGMocRlnOrCvnnSQuIsI0LDxxDKQJj9MI3qWfb9LkVRm 3+yIs5Qcn0cTgq1isXEd6d/7LFaXJReP8XIUqgfvNq/hN0PBDs+cKQjMdngogztnVr/+ aWQf/H5K7rp3Du2LrbG73bZd5leOA1eAMobEdcsMLJo3EUDNOhdMl5P52coekUoPofhf 1CtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918650; x=1709523450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J7dLHEfLQ42SROzcUDGEmQ80CzWJlvbdGfW9FhtTznU=; b=MD48WPNJSZ8UdU/DnV+8QH8zS5v8OQqvsF4MEXCqTKiCPvrCnuMFNQG2rjyXJwoWgv 0Q5Mn+G73LXaNX96XE9spIDEScS4MBV99OnolHwB6T+dbxuo2Fj+JJM4eKPJmew/j+T7 VRq1wDjY7LfEjZYQLoICx2Zlt7WvFl20SV21H/aJlPdgHutddueixt8MNjproxdp4dtg mF7TVm/fh8SmztHE+7Qfcjwd9OSwq/fK/RSeriJZdUF2SJxkRMC8kd3XdptxziisN3VO L+Ei7mdU/2cb2ExosjvfU63lTPqagYjH7Z1eE+FlCxBUnmGxqzsgwD6nRi6i5wOhJspY 3AcA== X-Gm-Message-State: AOJu0Yx8oYdIWOprCKWHh4bUuf6qkCCXHo32BcLbS0OMUbj2oNCzrG1S wPqjFxEthw9IgLAP1tH0oFVj2jHr4ycjMvvxZn5jnwayIDCKdfieTJvmer1l X-Google-Smtp-Source: AGHT+IF0YoJnzltAyymF32UdWi0jYiEF9kHoYcXtUapbR7Vr0H8EfJ9nEAICmUsekLHV8DNoafoNjw== X-Received: by 2002:a05:6808:1795:b0:3c1:6ed1:949a with SMTP id bg21-20020a056808179500b003c16ed1949amr2714346oib.12.1708918650689; Sun, 25 Feb 2024 19:37:30 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:30 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 07/22] hfp_hf_bluez5: Drop use of g_strconcat Date: Sun, 25 Feb 2024 21:36:50 -0600 Message-ID: <20240226033724.1460079-7-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup_printf instead --- plugins/hfp_hf_bluez5.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c index d45dda9d4196..944d44ba3fc8 100644 --- a/plugins/hfp_hf_bluez5.c +++ b/plugins/hfp_hf_bluez5.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -213,11 +214,9 @@ static struct ofono_modem *modem_register(const char *device, GDBusProxy *proxy) dbus_message_iter_get_basic(&iter, &remote); - path = g_strconcat("hfp", device, NULL); - + path = l_strdup_printf("hfp%s", device); modem = ofono_modem_create(path, "hfp"); - - g_free(path); + l_free(path); if (modem == NULL) return NULL; From patchwork Mon Feb 26 03:36:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571230 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B5B3DDDC for ; Mon, 26 Feb 2024 03:37:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918654; cv=none; b=WDJf5yz57O9pjxUfrkykmvjKpN6tFJJxDwt9+tw5C92W5d+Ov8yajj9xX9jkr5eXDfKkLVJ7ui6VgWJ8CYn5q35NAjIotSNr1DEJ+9DvrxexeUGRg4Iv6O+C0ufOxMtOLR4qzUB2psb0PA1N2jZsUmsKbybGbt/48Xw09bNUxbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918654; c=relaxed/simple; bh=S+I/u2VrVVkb+ANFuNdZwp2N+X1UsFbl4R7TWkcN/As=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TawvgjqCIXMhCZteEHcr967jPtUj7rBo+cZldlImjrxlfyTdj21GHjmm2ah4zmBMNP88U5s6qPhu53ZC665e7g7oCLLNQQ8aCGyvLoxsE6+oQALme8xRT1Xb+mtmTrXbsUHPAWOWNi7PSS19ZNw2Is4N/MllBiDkhfkAX0mYRWI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MIQ/OZz4; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MIQ/OZz4" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3c19937913fso1002870b6e.3 for ; Sun, 25 Feb 2024 19:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918651; x=1709523451; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=55WXvEVzqm0Mqd2SystGX3mGPtj7zQ0w/CcvB0xYPP0=; b=MIQ/OZz4zGbm8rzo+6gTowAwGZ5AAeOHJ/fEozQ1WPaATUksR0D7bf9ALGPi0IX7My yM1V2TqZXO9gA6lHNByRuKrKyZnG17q6H97NOovxQ+07CKy9JV5MwHqpzQGNj2D9wlOB CB8XjJkJa/u6hyxUIWLl+NqF1EKgbDJb88hMpSV1+eRyEjK3f4JDW3a2hdFZ+AOVZMXh 3VcBAZbJMaNZXobVlC/vLlA0m2bM8S77ejVP/r9LEePiyj3vARtriypU7J+Xwt0jRrzv OuuXcq5cH432rJmTgd46CCtoGpP9z8g0zClu6O3cSMpLPqSFCNvIZEq4/moiVW1W7RJA uP4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918651; x=1709523451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=55WXvEVzqm0Mqd2SystGX3mGPtj7zQ0w/CcvB0xYPP0=; b=YbIJ8HrefduK3IJ2oCmUQk+nihF9f3welvY6PgBhvhOQJpnbS088CjyP5FP3K1JTES +H9g3AGP+3ar0oMAM+mLCJ1qWDFPSHpgyR6z3NfHN8pXofmQYq+ml5EoGG+nQz8Dzx5f n/i+3RIe/SQDosirgCt8sYJp2ic3YvBd79Sm8I4DFcZDtbfGQb3bXzfxJOADaW2qwhi9 2sJQW/CJbH1+b8pIgtQBwr3oJ/rcFRXxbErmCMKYsQIuODL6Tk8tVb4ZgKn3SRkCJn+w usCqM0Gjzc7YNzESEJHKakxqaCfPDSUWYzZkhLacYsDUHzam0Q2k5E4+oEQtk94QBbl4 4kaQ== X-Gm-Message-State: AOJu0Yzch2z17PfhoRO5mFA2gVeKExVJVvl7lQNUbPUpiiZYzLjnFuaQ 1ZWc0Wl9NDKksK4QFvIih7FTE2rX6+S1y+a3aQpibQ611VkF5LSU+V7V6Ikl X-Google-Smtp-Source: AGHT+IEMTN2E1aQYU9Y1HF5L8/xPtedLiEBpgHpWQ53z9ppYqHvFFh0RffsI9pk0C6jMenUeTNsojA== X-Received: by 2002:a05:6808:9b5:b0:3c0:a25:bb4e with SMTP id e21-20020a05680809b500b003c00a25bb4emr6079078oig.35.1708918651344; Sun, 25 Feb 2024 19:37:31 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:31 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 08/22] simfs: Remove g_strdup_printf use Date: Sun, 25 Feb 2024 21:36:51 -0600 Message-ID: <20240226033724.1460079-8-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup_printf --- src/simfs.c | 48 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/src/simfs.c b/src/simfs.c index 38d4852b1886..4cd7f5b5c481 100644 --- a/src/simfs.c +++ b/src/simfs.c @@ -658,9 +658,9 @@ static void sim_fs_op_cache_fileinfo(struct sim_fs *fs, fileinfo[5] = record_length & 0xff; fileinfo[6] = file_status; - path = g_strdup_printf(SIM_CACHE_PATH, imsi, phase, op->id); + path = l_strdup_printf(SIM_CACHE_PATH, imsi, phase, op->id); fs->fd = L_TFR(open(path, O_WRONLY | O_CREAT | O_TRUNC, SIM_CACHE_MODE)); - g_free(path); + l_free(path); if (fs->fd == -1) return; @@ -755,13 +755,9 @@ static gboolean sim_fs_op_check_cached(struct sim_fs *fs) if (imsi == NULL || phase == OFONO_SIM_PHASE_UNKNOWN) return FALSE; - path = g_strdup_printf(SIM_CACHE_PATH, imsi, phase, op->id); - - if (path == NULL) - return FALSE; - + path = l_strdup_printf(SIM_CACHE_PATH, imsi, phase, op->id); fd = L_TFR(open(path, O_RDWR)); - g_free(path); + l_free(path); if (fd == -1) { if (errno != ENOENT) @@ -1183,11 +1179,11 @@ char *sim_fs_get_cached_image(struct sim_fs *fs, int id) if (phase == OFONO_SIM_PHASE_UNKNOWN) return NULL; - path = g_strdup_printf(SIM_IMAGE_CACHE_PATH, imsi, phase, id); + path = l_strdup_printf(SIM_IMAGE_CACHE_PATH, imsi, phase, id); L_TFR(stat(path, &st_buf)); fd = L_TFR(open(path, O_RDONLY)); - g_free(path); + l_free(path); if (fd < 0) return NULL; @@ -1223,9 +1219,9 @@ static void remove_cachefile(const char *imsi, enum ofono_sim_phase phase, if (sscanf(file->d_name, "%4x", &id) != 1) return; - path = g_strdup_printf(SIM_CACHE_PATH, imsi, phase, id); + path = l_strdup_printf(SIM_CACHE_PATH, imsi, phase, id); remove(path); - g_free(path); + l_free(path); } static void remove_imagefile(const char *imsi, enum ofono_sim_phase phase, @@ -1240,9 +1236,9 @@ static void remove_imagefile(const char *imsi, enum ofono_sim_phase phase, if (sscanf(file->d_name, "%d", &id) != 1) return; - path = g_strdup_printf(SIM_IMAGE_CACHE_PATH, imsi, phase, id); + path = l_strdup_printf(SIM_IMAGE_CACHE_PATH, imsi, phase, id); remove(path); - g_free(path); + l_free(path); } void sim_fs_check_version(struct sim_fs *fs) @@ -1268,20 +1264,20 @@ void sim_fs_cache_flush(struct sim_fs *fs) { const char *imsi = ofono_sim_get_imsi(fs->sim); enum ofono_sim_phase phase = ofono_sim_get_phase(fs->sim); - char *path = g_strdup_printf(SIM_CACHE_BASEPATH, imsi, phase); + char *path = l_strdup_printf(SIM_CACHE_BASEPATH, imsi, phase); struct dirent **entries; int len = scandir(path, &entries, NULL, alphasort); - g_free(path); + l_free(path); if (len > 0) { /* Remove all file ids */ while (len--) { remove_cachefile(imsi, phase, entries[len]); - g_free(entries[len]); + free(entries[len]); } - g_free(entries); + free(entries); } sim_fs_image_cache_flush(fs); @@ -1291,21 +1287,21 @@ void sim_fs_cache_flush_file(struct sim_fs *fs, int id) { const char *imsi = ofono_sim_get_imsi(fs->sim); enum ofono_sim_phase phase = ofono_sim_get_phase(fs->sim); - char *path = g_strdup_printf(SIM_CACHE_PATH, imsi, phase, id); + char *path = l_strdup_printf(SIM_CACHE_PATH, imsi, phase, id); remove(path); - g_free(path); + l_free(path); } void sim_fs_image_cache_flush(struct sim_fs *fs) { const char *imsi = ofono_sim_get_imsi(fs->sim); enum ofono_sim_phase phase = ofono_sim_get_phase(fs->sim); - char *path = g_strdup_printf(SIM_IMAGE_CACHE_BASEPATH, imsi, phase); + char *path = l_strdup_printf(SIM_IMAGE_CACHE_BASEPATH, imsi, phase); struct dirent **entries; int len = scandir(path, &entries, NULL, alphasort); - g_free(path); + l_free(path); if (len <= 0) return; @@ -1313,18 +1309,18 @@ void sim_fs_image_cache_flush(struct sim_fs *fs) /* Remove everything */ while (len--) { remove_imagefile(imsi, phase, entries[len]); - g_free(entries[len]); + free(entries[len]); } - g_free(entries); + free(entries); } void sim_fs_image_cache_flush_file(struct sim_fs *fs, int id) { const char *imsi = ofono_sim_get_imsi(fs->sim); enum ofono_sim_phase phase = ofono_sim_get_phase(fs->sim); - char *path = g_strdup_printf(SIM_IMAGE_CACHE_PATH, imsi, phase, id); + char *path = l_strdup_printf(SIM_IMAGE_CACHE_PATH, imsi, phase, id); remove(path); - g_free(path); + l_free(path); } From patchwork Mon Feb 26 03:36:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571229 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB08414008 for ; Mon, 26 Feb 2024 03:37:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918654; cv=none; b=WGwiHkDYcWCM3lDO6DV/8iRq0F9CXr3R8tu9n7zd1t4AmR6iLHv+XW+wHHYfVSqc9K4VVmm1NYrljIaA5cI4W8mJSVbfU+gCaMh2v0P3KVCTIjf7g13qFWDGpwWPc5igb0/m6B0GKFbIXRxRm9rDzFvoBv0HnCLM20TXeNGeWnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918654; c=relaxed/simple; bh=pmXUpmJL0WjCROdBkmZeDlYHEe0AvPHhS8xNUDT1Pi0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c/MNZCsaid6v9nYvEyhIZa/Agme1nTK/mt/vIuRHMif9gvqNLJrufCd+mLVXd4LzloFXZUMCMry51YD9W7ZMlq53PnYWbQzK+7+IYdDQ69d8yy8GBYMvG0u+ycjP36R5wOcg6GrDvz15n/3PKp4H4fabbvMX3hKZNs7mQn1xbn8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Me2JSAB+; arc=none smtp.client-ip=209.85.167.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Me2JSAB+" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3c1a172e46bso320295b6e.3 for ; Sun, 25 Feb 2024 19:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918652; x=1709523452; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r56Qipg9e1CjBWEjDS+aIR96yI5YLGLmK0sYuF2RKOQ=; b=Me2JSAB+WodZxKC1kRWw2kq4JP7wfCOzPhBG45IM02X2bPJ9f80co0lNqhFe90uny6 JuAC5r+0ulYPHLTHEg7f9CowMlOTE34xzn+2AmQn6ckb8bcICWDKfWPtPD9K/jkJUp1w EA50AeX0lBxanBmYxs4diK5yZ4Gg8+ohm8WV9CQKZNBaww/F9QqO3N5ht+F/G1jSIOLY tf+es/AD7KO5V5Fiu35/Na0AP9l/En4emn2bqg66APCHh5sUM2JnkjjrIkTVgM0wcDV3 ImOzWFklWs4zWAVhbVagFFjzAY7Ybg5ZXJg+iAWfBY6NsQR9VISDxXsa+2N55V9GUqUF GH8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918652; x=1709523452; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r56Qipg9e1CjBWEjDS+aIR96yI5YLGLmK0sYuF2RKOQ=; b=oFg/oskCrGLVDeR10mI3NJwJIy4m6fM3QpTW5ii0yqTHOzdQbnqcRsxWYBQHcbdYmY Wzp3M1eKs+RXFIyAZUBZ/SrDpNKBSekkPQ9jcQDbubdWx341Mj2QBZ1rA6UvkLf03++V YDMSMzzqGWji/4Vo3gvT4xefSr5Siodu46oYQeRzdqtglzd/raz+ogZxWacCtYOEOzSt rNjTNu5kfDYG8JPifypwS+9MZcNOGqpSNCJ9DqwgIQ3WpgWDwCPlaUDNJkf9uHQPtZgc I+qYaJdEAxHUHAfC06hGS2szMPxwg42Vset49waYO18gmOAakX4BkH2iL7Nv1NrmDwKQ zhqg== X-Gm-Message-State: AOJu0YyYjh5+4ipO0IqqRYEV3TfVDH4kBRJAZuSPGW7MXVHJLQkwoa1J c3AvU1O0rafIr7YEPISuqEWWWXBSCYb0KIWqD5HsctHBXOphEaKLkwPZFOQm X-Google-Smtp-Source: AGHT+IHnP/WUlC0UaJWrfO4POFawOHGKSWjVDeWZZa8A2030Mql5I4b8b0lIBqMuqcuSbJP7eAnzQQ== X-Received: by 2002:a05:6808:3a0d:b0:3c1:83e8:4e99 with SMTP id gr13-20020a0568083a0d00b003c183e84e99mr11839344oib.32.1708918652084; Sun, 25 Feb 2024 19:37:32 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:31 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 09/22] sim-auth: Remove g_strdup_printf use Date: Sun, 25 Feb 2024 21:36:52 -0600 Message-ID: <20240226033724.1460079-9-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup_printf --- src/sim-auth.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sim-auth.c b/src/sim-auth.c index 6dab52eeebde..679343263a09 100644 --- a/src/sim-auth.c +++ b/src/sim-auth.c @@ -138,7 +138,7 @@ static void sim_auth_unregister(struct ofono_atom *atom) struct ofono_sim_auth *sa = __ofono_atom_get_data(atom); free_apps(sa); - g_free(sa->nai); + l_free(sa->nai); if (sa->pending) { __ofono_dbus_pending_reply(&sa->pending->msg, @@ -671,8 +671,8 @@ static char *build_nai(const char *imsi) memcpy(mnc + 1, imsi + 3, 2); } - nai = g_strdup_printf("%s@ims.mnc%.3s.mcc%.3s.3gppnetwork.org", - imsi, mnc, mcc); + nai = l_strdup_printf("%s@ims.mnc%.3s.mcc%.3s.3gppnetwork.org", + imsi, mnc, mcc); return nai; } @@ -751,7 +751,7 @@ loop_end: if (!__ofono_sim_get_impi(sa->sim)) sa->nai = build_nai(ofono_sim_get_imsi(sa->sim)); else - sa->nai = g_strdup(__ofono_sim_get_impi(sa->sim)); + sa->nai = l_strdup(__ofono_sim_get_impi(sa->sim)); g_dbus_register_interface(conn, path, OFONO_SIM_AUTHENTICATION_INTERFACE, From patchwork Mon Feb 26 03:36:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571231 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD48115ACB for ; Mon, 26 Feb 2024 03:37:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918655; cv=none; b=rn9EEe89imNr5eABde/V48I6i9DoFUznzhYOjIC6Q0KijwjwgdUR1QzFu2rn84lhuMFAkZaTAhVMPlUmo5Dx5yPwUO5IWwmWxgJSGezr1XdSRGln+zg9j9BJeGFYPydOATQDmBPf3ROl6PnCCfkU1dspVy7HCjRj0dSHEqLzqvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918655; c=relaxed/simple; bh=EeAVPglO9HFH1Y/J3+HRJP1EugqVaCyhJf6KvzsJUGs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qTEj0WNLX363BurAZZGZkXlxSXJCQIp/+ojKG6YWY8R0kWq/3B9rBrU/3KqOodwC8ELvrCmM8UftHHcG7tpqcMMtVh1NIyOlhaM48aglj2bcjXY3/Xx5HfqriblVRBcw6m082cYZ95BGV4O9k/PgaNTrln2jIW5gycqagP5IUqA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FRjCMd/Q; arc=none smtp.client-ip=209.85.210.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FRjCMd/Q" Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6e45ef83c54so1692736a34.2 for ; Sun, 25 Feb 2024 19:37:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918652; x=1709523452; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RZFPxTyv6haRgogEhOYv9s05kEjB+b3MvYxemJGngPU=; b=FRjCMd/Q1BNOHMoqiQTefA1KUQuw7I8Jgq5gp3myZXxT73ICIdj7UHGhQ3T2VA+ACS RLRoKJ8RQDraW1zB5gN1tMlWAuRiVn6VyrEwEqHnIzY5BhpGTXNl7680MuQKI4Wmv7gX J21xFrWG3Pb4aY+WJWjMP1dPLAyDDslrBnbX79WvSaI01S6YOIHdMgKOGaVSv1+Mz2nw eZfMe6e4hbg6z3luPVaE5GYwSDA7suftB+uLcjkQwsTRoTIuRzOTWZZJOMXmeiZTBROv 6y6+eXpaWBztDgltVnfaNpJeJQqWEKrKes4YbCnGKPMCTwJbK88UTdtZIOQryH9i27f/ ELdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918652; x=1709523452; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RZFPxTyv6haRgogEhOYv9s05kEjB+b3MvYxemJGngPU=; b=Bt++wOYiwORZOcbae5DZUqek0oa999bgjmvlLwd8rpb2Yt50xUh/eXqvYOySb4O8C0 Hhsl+LmBdGVljFAch/D9wqAejdoYDfD6eXmq0UQlDt6InV7cNkSQdHqqQy61ea5Zaw9g ZZzmS43ySha4GbR8LMViD2iYDM3T57p8Nj+ZhOK58bKdQuw14BjEqSTm+SHAJozKCovk pH3GTsqAXaej4CVQmdUHrR8dKhLi385Imn/LAxlTsg57FBLOs/A6SMknf1sB63qG0mYL ki9VFpCUqR5LAtlSVQ3OnKhisdQpidAbw+Yt9nfWkWqGd/lQyzOvW13UZU1PO1wMymd+ yaeg== X-Gm-Message-State: AOJu0Yy4OtXeeXSyX03CeVjOQOx/uHTsRsArUVabVFg7xgker/DZhi7g K4/STgoDjrL+1WfxZ887JkBXkfs31AaTi/7fmP+Tw1BAOULzeOgKBbPaeNkX X-Google-Smtp-Source: AGHT+IHRpS4GMTePqPBce1/fgXcXQyyRFDfif2vz1PppU6z1xEdHPnwhnzAmMqlPjdSz22nS1Bpg2w== X-Received: by 2002:a05:6808:3088:b0:3c1:5312:6de2 with SMTP id bl8-20020a056808308800b003c153126de2mr8401553oib.47.1708918652713; Sun, 25 Feb 2024 19:37:32 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:32 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 10/22] smsutil: Remove g_strdup_printf use Date: Sun, 25 Feb 2024 21:36:53 -0600 Message-ID: <20240226033724.1460079-10-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup_printf. While here also replace use of g_free with free() where data returned by the invocation of standard C functions needs to be freed. --- src/smsutil.c | 71 ++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/src/smsutil.c b/src/smsutil.c index 05942d6fe56b..954f92df2c0d 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -2442,10 +2442,10 @@ static void sms_assembly_load(struct sms_assembly *assembly, if (sms_assembly_extract_address(straddr, &addr) == FALSE) return; - path = g_strdup_printf(SMS_BACKUP_PATH "/%s", + path = l_strdup_printf(SMS_BACKUP_PATH "/%s", assembly->imsi, dir->d_name); len = scandir(path, &segments, NULL, versionsort); - g_free(path); + l_free(path); if (len < 0) return; @@ -2467,11 +2467,11 @@ static void sms_assembly_load(struct sms_assembly *assembly, if (!sms_deserialize(buf, &segment, r)) continue; - path = g_strdup_printf(SMS_BACKUP_PATH "/%s/%s", + path = l_strdup_printf(SMS_BACKUP_PATH "/%s/%s", assembly->imsi, dir->d_name, segments[i]->d_name); r = stat(path, &segment_stat); - g_free(path); + l_free(path); if (r != 0) continue; @@ -2529,18 +2529,18 @@ static void sms_assembly_backup_free(struct sms_assembly *assembly, int bit = 1 << (seq % 32); if (node->bitmap[offset] & bit) { - path = g_strdup_printf(SMS_BACKUP_PATH_FILE, + path = l_strdup_printf(SMS_BACKUP_PATH_FILE, assembly->imsi, straddr, node->ref, node->max_fragments, seq); unlink(path); - g_free(path); + l_free(path); } } - path = g_strdup_printf(SMS_BACKUP_PATH_DIR, assembly->imsi, straddr, + path = l_strdup_printf(SMS_BACKUP_PATH_DIR, assembly->imsi, straddr, node->ref, node->max_fragments); rmdir(path); - g_free(path); + l_free(path); } struct sms_assembly *sms_assembly_new(const char *imsi) @@ -2555,9 +2555,9 @@ struct sms_assembly *sms_assembly_new(const char *imsi) /* Restore state from backup */ - path = g_strdup_printf(SMS_BACKUP_PATH, imsi); + path = l_strdup_printf(SMS_BACKUP_PATH, imsi); len = scandir(path, &entries, NULL, alphasort); - g_free(path); + l_free(path); if (len < 0) return ret; @@ -2843,10 +2843,9 @@ struct status_report_assembly *status_report_assembly_new(const char *imsi) ret->imsi = imsi; /* Restore state from backup */ - path = g_strdup_printf(SMS_SR_BACKUP_PATH, imsi); + path = l_strdup_printf(SMS_SR_BACKUP_PATH, imsi); len = scandir(path, &addresses, NULL, alphasort); - - g_free(path); + l_free(path); if (len < 0) return ret; @@ -2912,11 +2911,10 @@ static gboolean sr_assembly_remove_fragment_backup(const char *imsi, if (encode_hex_own_buf(sha1, SMS_MSGID_LEN, 0, msgid_str) == FALSE) return FALSE; - path = g_strdup_printf(SMS_SR_BACKUP_PATH_FILE, + path = l_strdup_printf(SMS_SR_BACKUP_PATH_FILE, imsi, straddr, msgid_str); - unlink(path); - g_free(path); + l_free(path); return TRUE; } @@ -3232,9 +3230,9 @@ static GSList *sms_tx_load(const char *imsi, const struct dirent *dir) if (dir->d_type != DT_DIR) return NULL; - path = g_strdup_printf(SMS_TX_BACKUP_PATH "/%s", imsi, dir->d_name); + path = l_strdup_printf(SMS_TX_BACKUP_PATH "/%s", imsi, dir->d_name); len = scandir(path, &pdus, sms_tx_load_filter, versionsort); - g_free(path); + l_free(path); if (len < 0) return NULL; @@ -3287,7 +3285,7 @@ GQueue *sms_tx_queue_load(const char *imsi) if (imsi == NULL) return NULL; - path = g_strdup_printf(SMS_TX_BACKUP_PATH, imsi); + path = l_strdup_printf(SMS_TX_BACKUP_PATH, imsi); len = scandir(path, &entries, sms_tx_queue_filter, versionsort); if (len < 0) @@ -3329,24 +3327,24 @@ GQueue *sms_tx_queue_load(const char *imsi) continue; } - oldpath = g_strdup_printf("%s/%s", path, dir->d_name); - newpath = g_strdup_printf(SMS_TX_BACKUP_PATH_DIR, + oldpath = l_strdup_printf("%s/%s", path, dir->d_name); + newpath = l_strdup_printf(SMS_TX_BACKUP_PATH_DIR, imsi, id++, flags, uuid); /* rename directory to reflect new position in queue */ rename(oldpath, newpath); - g_free(newpath); - g_free(oldpath); + l_free(newpath); + l_free(oldpath); } for (i = 0; i < len; i++) - g_free(entries[i]); + free(entries[i]); - g_free(entries); + free(entries); nodir_exit: - g_free(path); + l_free(path); return retq; } @@ -3382,7 +3380,7 @@ void sms_tx_backup_free(const char *imsi, unsigned long id, struct dirent **entries; int len; - path = g_strdup_printf(SMS_TX_BACKUP_PATH_DIR, + path = l_strdup_printf(SMS_TX_BACKUP_PATH_DIR, imsi, id, flags, uuid); len = scandir(path, &entries, NULL, versionsort); @@ -3393,22 +3391,22 @@ void sms_tx_backup_free(const char *imsi, unsigned long id, /* skip '..' and '.' entries */ while (len-- > 2) { struct dirent *dir = entries[len]; - char *file = g_strdup_printf("%s/%s", path, dir->d_name); + char *file = l_strdup_printf("%s/%s", path, dir->d_name); unlink(file); - g_free(file); + l_free(file); - g_free(entries[len]); + free(entries[len]); } - g_free(entries[1]); - g_free(entries[0]); - g_free(entries); + free(entries[1]); + free(entries[0]); + free(entries); rmdir(path); nodir_exit: - g_free(path); + l_free(path); } void sms_tx_backup_remove(const char *imsi, unsigned long id, @@ -3417,11 +3415,10 @@ void sms_tx_backup_remove(const char *imsi, unsigned long id, { char *path; - path = g_strdup_printf(SMS_TX_BACKUP_PATH_FILE, + path = l_strdup_printf(SMS_TX_BACKUP_PATH_FILE, imsi, id, flags, uuid, seq); unlink(path); - - g_free(path); + l_free(path); } static inline GSList *sms_list_append(GSList *l, const struct sms *in) From patchwork Mon Feb 26 03:36:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571232 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AB6114A85 for ; Mon, 26 Feb 2024 03:37:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918655; cv=none; b=UY7D9yhGeceKg2vUYOdkZj1Uv585CX7Y5h5xU0OiaqyPcLhTYBCdITFvwEls3LvALoV+SrguYDKBqqGvizzGDNmi1GVVQVUT/8C+qVGBu9SsQCvF0zi6+KN6TR3bd53KOjid8A6Km4uF1K8J9ZUrcOXirQD5OHy5J1wCXa70MDU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918655; c=relaxed/simple; bh=b6I3KDbH8KUhiDXk8Zjd5aU2KGfXJx/QMhGU+iulAp0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A980WWwJo886SvUgZTHNbKLWBBLTN402AdJpX4cZBQB/dIwvYDJnD5EEBmmqLjKSLaB5SMAMgvR54iKOBInBAqfNWjHFAkxbHNKHLmMEqR2x2VxfBHmKp0vUSiKFKVdk4UecdF1V4P8cwoQPtBuROpA3pmzTFSG6WZ5hMG2SQOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RO2CSOjl; arc=none smtp.client-ip=209.85.167.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RO2CSOjl" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3c199237eaeso1137029b6e.0 for ; Sun, 25 Feb 2024 19:37:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918653; x=1709523453; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ql1M7Cokb3tPCFBKBrORoPfwT8JVY5e83/vyr3UuU1Q=; b=RO2CSOjlVS5z6pX/eSAKhsJuifT32G+lW6ZzfGZAhb9g98pnHreFIzcmY6v7lb+Uzk v9OMdsJYaMNGJSR18fexiPhHUM7hIVuFrdXwXjbMLrpD1NMiEnWcQe0pQQurkq3CWOwg J0dG8bM4kQhd1eKWWK0VZ8wn5Fk6MbG6ui/QMVgcW1LqP3REufwYrbsj0dUB316dheID ou8zvew4JUtVqn+rY5zpUeeCu7gw/KqjDt2FRQv39VAuJz0YuwHsBquh930ofMKr1qMZ LeiTV//i6ZhnYV5+iKfUqDICqDE38r3Px8PrFKFiCDh+tVcWFqXFO7W2pXvk783DOje2 Ipsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918653; x=1709523453; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ql1M7Cokb3tPCFBKBrORoPfwT8JVY5e83/vyr3UuU1Q=; b=p7zB9TNMv74llOlScxjGqBbWJo1QGe37aJrWk5okkbo8BrYUgP+3xPLj+87dhXHCjb eUhOUVIkIJS84i+j4UU92BzzubDsw+ZlmXgcCsX7LKUSFfD5BpLxkUJpO0nG0ztwCZUZ VjhbACn6K7Jcd3uRkoCxrGgz+2r9Q7K02Xc8HBU2nX77UTMNMYeopG8FPhfXGxBsZjz9 MF/zUO8UCRjgGi7K4a5Sa+ekr/iZ+U7gsf7NFRCSmv5PSrUow7Az99MkDlhqslcu7QVh eSVZs20ItFYEAXD3Dg9evdcSKsjPDWrs9zS9Kg6RJbky6Pgfvdfy4kyFAR+dVdgc3D1w DAoA== X-Gm-Message-State: AOJu0YxdRQQAZgcuvGzpXd84To9HZ5+00hjhoD5TdNOysfLOKRoT+iD1 wP0V/2fUTWytKSrgCXzFtuBRlE1g+B+GQ7HU6hxOfBAgec3YlSAPFT1Qd+aM X-Google-Smtp-Source: AGHT+IEu0VGR3uH1d+Mos3h/paibaT4I1ehUGAtfvYE8YkiqoHyNoDBGu4KOJ3VPjRxJrmpYdXP/BA== X-Received: by 2002:a05:6808:23d1:b0:3c0:4653:6e9e with SMTP id bq17-20020a05680823d100b003c046536e9emr7906961oib.6.1708918653353; Sun, 25 Feb 2024 19:37:33 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:33 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 11/22] plugins: Replace g_strndup use with l_strndup Date: Sun, 25 Feb 2024 21:36:54 -0600 Message-ID: <20240226033724.1460079-11-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- plugins/allowed-apns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/allowed-apns.c b/plugins/allowed-apns.c index 199202b5c82b..63d1749043b4 100644 --- a/plugins/allowed-apns.c +++ b/plugins/allowed-apns.c @@ -116,7 +116,7 @@ static void sim_acl_read_cb(int ok, int total_length, int record, if (simple_tlv_iter_get_tag(&tlv_iter) != 0xDD) continue; - apn = g_strndup( + apn = l_strndup( (char *) simple_tlv_iter_get_data(&tlv_iter), simple_tlv_iter_get_length(&tlv_iter)); @@ -124,7 +124,7 @@ static void sim_acl_read_cb(int ok, int total_length, int record, DBUS_TYPE_STRING, &apn); - g_free(apn); + l_free(apn); } done: From patchwork Mon Feb 26 03:36:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571233 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1EF114008 for ; Mon, 26 Feb 2024 03:37:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918656; cv=none; b=oRiaEjz5al+LaNX71qyV7XSnIfs242GV4OkjVWjc2JCUkaHuhX9432IV1H5t+yt1M0UAXRH5p0XyW2MXfDK7bUBmhE2q1EA8QkCyK/gyEiuNJUi5TeKJKvxb412Ywo1T9BLXorq/UZt9flhvrHDihBjWTtYKmEYQbJqSg2caLCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918656; c=relaxed/simple; bh=wWcRXRU7+5u3yQX38wbFbVhhKAAhyFZPcWbpS3FQx8A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GY+FE2IlPXxG+9UgYP2rzZHXwCOxwBb5YvVtHinEHxl9CFFVlYRRQDdRNVsSrAmCkd5BCV/u8SwcBANWviwU+o/WIMN4sXNsoP6quEySPLRFaT6lbaw2tCKBiHf80/pzP5+UFecxKu2vvCApApCT7znC4wiioHBUzG/0K1tPRsw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EwuZhtT+; arc=none smtp.client-ip=209.85.167.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EwuZhtT+" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3c19e18470aso620267b6e.1 for ; Sun, 25 Feb 2024 19:37:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918654; x=1709523454; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cDRa1wgBsx+6j2ObcGJQP1tFuniTb2yF2lLbgkDYPwI=; b=EwuZhtT+Tsa8Fz92dvNnAjotj5Vx7EXLr7Q7Jt/Bo1HMRmQbYx8VSoHgaJ5U891ZNG ZDjBpxNw7qTm4tf43pR2J8v/TccPxvdgIUfrOepj4ZHRVZvViydtT/bkz4TWQCjeU31R ObvEmJ4+LRi8UTAIQXCWpOFrqzqibh1k/lRJYZNihULqr0UODJ2W+3eL4fFYMAtbHBeR sWdBGPoWh6w+hNA86MNo6qXaadLicR9XyNjr4X8b+8Wklgl/O10qfw90FQo2gbiP9XMd CINdp0daLsPaVwruYRvfQHo2guxZ+goXV7LuXg/sg3jD2FzCXTGuNMiRJ4OCBKN/Mbyz lGpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918654; x=1709523454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cDRa1wgBsx+6j2ObcGJQP1tFuniTb2yF2lLbgkDYPwI=; b=IEZPvVU/x/4eEq3JcwFN8e3lmrZUgdxSegK/RAw3tRXmbCY4ViGI4oyF5xOz+vyncm K2ABQU11mEh4uEeya57h6ctboPF/o8wQBdHTjL5KuWShn6sh5Ap0gUFcrid/q0yWh7MD +lvAiXb+P5736gtcZ7pZ6w+PM0ZNlkkWCmEOCUfbKgblaF2I+czfbqSN+/0jpLzuqg19 xSNEa5Ij3i9pp47L6bnowFGqDcM6tnNAs7U3NkISzO56703/5eSUKVkwprw2pvRCL89N cZWpP5kOckoKq/N0CQNmaa14IpbUYGl9O0wEcPuAB3pLb8GrHO+6pqD9jtc0iyONqq8F 7rwg== X-Gm-Message-State: AOJu0YzMX45kTlRQzx8pd9FB8SI8QJXeF5IU172lPAfoIjhbGV4cmELF qOyeOrydhOnsRR3CeObTST8IG5D1aqfLLfSTe30cbOOy85kqpDEavdLtnNlT X-Google-Smtp-Source: AGHT+IHmws7nOEhkqdGNJ9U9KrR8LJR729Nhqve6jgTAvL9+ucv3OcRjInTqU3yed501vx3cuVzA9w== X-Received: by 2002:a05:6808:15aa:b0:3c1:944d:429e with SMTP id t42-20020a05680815aa00b003c1944d429emr6649458oiw.7.1708918653976; Sun, 25 Feb 2024 19:37:33 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:33 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 12/22] phonebook: Replace g_strndup use with l_strndup Date: Sun, 25 Feb 2024 21:36:55 -0600 Message-ID: <20240226033724.1460079-12-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/phonebook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/phonebook.c b/src/phonebook.c index 122ba83c066e..eb48980e7a3b 100644 --- a/src/phonebook.c +++ b/src/phonebook.c @@ -267,7 +267,7 @@ static void print_merged_entry(gpointer pointer, gpointer user_data) static void destroy_merged_entry(gpointer pointer) { struct phonebook_person *person = pointer; - g_free(person->text); + l_free(person->text); g_free(person->group); g_free(person->email); g_free(person->sip_uri); @@ -386,7 +386,7 @@ void ofono_phonebook_entry(struct ofono_phonebook *phonebook, int index, person = g_new0(struct phonebook_person, 1); phonebook->merge_list = g_slist_prepend(phonebook->merge_list, person); - person->text = g_strndup(text, len_text); + person->text = l_strndup(text, len_text); } merge_field_number(&(person->number_list), number, type, From patchwork Mon Feb 26 03:36:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571234 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FC8D156CF for ; Mon, 26 Feb 2024 03:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918657; cv=none; b=YJb3yqP/muJX88ub97IsjuFcICSVQIgnyNxLVpXDGLRQ7Sl3sZYUYiyJrUZkz9xEb/6g3uM0B3K4wKRsk0yeM4e59tH0JK0ALmP13dqazMGjIBik5ifNvVWUtHOFqX2Vc+mnd8FVd4ibL3E2VWQlcpgry72+i3fv7HvvFWy39xk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918657; c=relaxed/simple; bh=r2GcZxnhBIq0PcPjxFp2pLCICfCDt8K7XPVzx49zWjk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t/TzhoOqqnPGnRpualHq6ywwzakRjwPQTEDLAYsU08AU8ePwN5j//DzdiC2A+28c6Cn99wzG9MTQm+ZtqjjwXB+nNeNZx7iWFjZ0Z6BIvUUOLOWqCOrQKe/wzdsfGB/AkIvAb80OGPHDXQ0GJliBJm5HIwgKqdyfmXZrbKPUfZ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JYQFQi//; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JYQFQi//" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3c1993331a7so1082432b6e.1 for ; Sun, 25 Feb 2024 19:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918654; x=1709523454; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AiPsyDLa3KfVrmhaONLGjgtJdYBAbMGnB5WjyJn9lrM=; b=JYQFQi//xGEk0emXWaWOSMaWmE3esLuhf0Tm1LHjnnDtE5U8nRD95HqEloqtEHx3hd Yb9aTmWKbsVhZmWvRKXP61GgTzQME5Y+AYpdOxdlkKsD3xq9msoZ/PTtw2Na46UooJf1 V90a9MYMgMiw7L9YQfJmm4vamrLGhXF2mwzj1rO/wq5yDiT8HWnVWj/EBCwBNbyS1m2S QXednffCOdi7zHF0q7EuawVhazI+CNCjQZ+xcz1QIRU6GI9bni1fLdyceD12RI+NvGK2 YNNW4cfbpG8V095ADDZbu+wn2PiWztqIcHm1jLlOp/ik/onYp1Z43tEmNnIZc4EbHuUa DTIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918654; x=1709523454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AiPsyDLa3KfVrmhaONLGjgtJdYBAbMGnB5WjyJn9lrM=; b=INZ3kCxwpm2Fby3wOZ0bFz8oDk+X/eQB5WquxJTADl1zbRqoA/E2vkvFBxgaJ7LRji 0ujwrhH67C2LFmxfRBMZ4ZJcbLUvoQkEOYjZWCjHXnOUXki6DyTZCscIEfj1KBwZR0hP nWjPqD9Rny5wEYMvgD94z6Vkq5D+WJxrxfS+Pu69zA/4LSHyxeUiZSb3A+XpK8vIFBy1 SwA0JAjgXMtR6s7RY8JfRHEJZxgDbY/nDt5Ggnxr/V7YYnFjMYj4MmxuqJqBbRXdnjUi d0DPklllBUvYxp5Jehknkyl9pYdcujfgwTo+iNMb7AJI1mYGkEo7QfbTYkI/f/Va4Xxy PJuA== X-Gm-Message-State: AOJu0Yyq4IBw77dL52sD0bsfQPrptj+SY6D0L1wg7RmiKm55ld8nKABi fnkg6DmuFwVOtm40QDcuRvgXR1bOw6+rCRxUNUbcY28fCb+3PdCbmEnlKpEs X-Google-Smtp-Source: AGHT+IEA1PV4tsWaDrLwc65aXaIZAOtYRNFFYDGMgSl2/B+/iJK35BZi4DYfcAyLax3S/ZEeQulABQ== X-Received: by 2002:a05:6808:10ce:b0:3c1:784b:d67e with SMTP id s14-20020a05680810ce00b003c1784bd67emr8175932ois.10.1708918654551; Sun, 25 Feb 2024 19:37:34 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:34 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 13/22] sim: Replace g_strndup use with l_strndup Date: Sun, 25 Feb 2024 21:36:56 -0600 Message-ID: <20240226033724.1460079-13-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/sim.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sim.c b/src/sim.c index db65d22f40fd..d941415a4879 100644 --- a/src/sim.c +++ b/src/sim.c @@ -1661,7 +1661,7 @@ static void impi_read_cb(int ok, int total_length, int record, } if (validate_utf8_tlv(data)) - sim->impi = g_strndup((const char *)data + 2, data[1]); + sim->impi = l_strndup((const char *)data + 2, data[1]); } static void discover_apps_cb(const struct ofono_error *error, @@ -2721,8 +2721,7 @@ static void sim_free_main_state(struct ofono_sim *sim) sim->isim_context = NULL; } - if (sim->impi) - g_free(sim->impi); + l_free(sim->impi); if (sim->aid_list) { g_slist_free_full(sim->aid_list, From patchwork Mon Feb 26 03:36:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571235 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A30D14A85 for ; Mon, 26 Feb 2024 03:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918657; cv=none; b=pizBQe+inYCKCkoFzSVmgwlwMjiHHWq14DTv1f2Mg+i0rjtHZFnqNFfRt777Uq5Vd8Z7opHfl+zkcvKZs+uuLPOqY4OXwL/15ZocOLSUDnikZx99zkyZ6/s5jubsn8j9niivImKpqr1ZNIldDTGl2d/bBFRZ9lYAZg+nKehz75c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918657; c=relaxed/simple; bh=al6R+Fbw2u0FbgEYPR2ioNipISnepMJdBchYdrlaREk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GFWbMYypmKcfiNaeqFmd43lEQ8y/2B8URx9uVXbAGOLzFDkrmUmHLw7Z847Ul1HKPzaO1UY4sbbzJPyynE40iqX2MQZrjMSMWVRm7eiHRDF2Dd/WTFxzltiy1m3HyUNSLMfsppbJQqau3ZnbUOCvo2FJFpL2wQwWmgc5sMwPQVk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N2S9vLyW; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N2S9vLyW" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3bbd6ea06f5so1535515b6e.1 for ; Sun, 25 Feb 2024 19:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918655; x=1709523455; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NxMZhn4kJzl8zbmdJ0ph9eFxnbpZvzk3LUVfXjg3RgQ=; b=N2S9vLyWzscRqScZWXwnkzHFZqI8vDDbL0Ei5ZOoCZ2IDfPP1BMDHgqRUeTzukuZ/i +I2QyqA8Uu4vIoALK7ZiXHrTdpZAJDrtKzoQcffZazjBNeyG/SV/lr1wNIK5Meh916jG ojoB6JJKXOS6t/R14J3D3rYWXA0HuFV45Bghd39wd0iRSAJm2TX5w8BTTNlXTaGDud8D VkeCkIP2HsU0orPKWXDPmoJ9Go4ixr5xhk620VOPENwQU0BxM5EgueXiXkBX83pMi2hn lGkgsxASduXmcTVum2SU2lJSAgbhswiCZzuqjBsj+TDxzSCJXC5Op8LxJYCuBhyi79a9 Kukw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918655; x=1709523455; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NxMZhn4kJzl8zbmdJ0ph9eFxnbpZvzk3LUVfXjg3RgQ=; b=POYdkRYxqDv7umT87V/AcLmQ0MjcPwHqCQU1B5NjRjZ5m38S24aa79bn0Uz3g6TOef galgGJYsXe6fTZ7Gwm4jpXSKR+Ac6d1kmJGAQu3bDEwwe/CZVyvCmRdB4xj19pAx7FAw AyQSdP7T4lzJSa/p6ndLQ6q5DFeNLO8/EPLXOWPhSP7MY+1e1+Cb95es9ZqCRJmwtVT+ CuHaq2oDyWJklOMdmOlsO5zoILztYNsgmBOh4AkSCT4y5T6JbKwePZth4hgHq6fagOcO JBrsw0TfKyjmfv9O/T+qJaaKvC8oF6yfhfcmU41uitXXMhoIkv1iuNQIOHhvoioZZcPJ elNw== X-Gm-Message-State: AOJu0YxKYvlNpsAYpJ3KKzwA8GcXZ4IUoq14Tr3I3clhfzP68JZtS2h3 51f3Pg5eYIVPCVAlLiKp4LMA9kK4FvYm4C+ue6l+Vs6ccqTYoPymgn67zKC1 X-Google-Smtp-Source: AGHT+IHL21ukQOmSuNdsGt4fIXQhcZfujAMWLsl0haa5uO3T5Nfqwo4dpj8MqwYd149naxa7XBBLbQ== X-Received: by 2002:a05:6808:a8b:b0:3c1:8043:3f6c with SMTP id q11-20020a0568080a8b00b003c180433f6cmr2076279oij.11.1708918655195; Sun, 25 Feb 2024 19:37:35 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:34 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 14/22] gprs: Remove use of g_str_has_prefix Date: Sun, 25 Feb 2024 21:36:57 -0600 Message-ID: <20240226033724.1460079-14-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_str_has_prefix --- src/gprs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 67f0d7803525..ae0d5ae8a387 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -1968,7 +1968,7 @@ static struct pri_context *find_usable_context(struct ofono_gprs *gprs, * web.provider.com but it apepars as * web.provider.com.mncX.mccY.gprs . */ - if (g_str_has_prefix(apn, pri_ctx->context.apn)) + if (l_str_has_prefix(apn, pri_ctx->context.apn)) return pri_ctx; } @@ -3304,8 +3304,8 @@ static void gprs_load_settings(struct ofono_gprs *gprs, const char *imsi) if (g_str_equal(groups[i], SETTINGS_GROUP)) continue; - if (!g_str_has_prefix(groups[i], "context")) { - if (!g_str_has_prefix(groups[i], "primarycontext")) + if (!l_str_has_prefix(groups[i], "context")) { + if (!l_str_has_prefix(groups[i], "primarycontext")) goto remove; legacy = TRUE; From patchwork Mon Feb 26 03:36:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571236 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E106D14008 for ; Mon, 26 Feb 2024 03:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918658; cv=none; b=PIyQEuRuTVXrlGLrJiqleM4CmF/34sPK8KIyWX27VVjKlU1M3ok1chVndnGYK/beWMxK6BKVWFOClz1GX/sYx3awdpbu+U2RJhRan+fo3gLfG4Sn5BwJSB1cCdQNJ0mV6PraI2l5uT4Kaq5zyb4zhc2J2bSOfp5+i4hVNOe2SNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918658; c=relaxed/simple; bh=JqRBUuNQ3133t6qTNSfC1Jp9fq3zqCtyFrEb45nS+6o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ufWbtxDe8QX6f9XW/gaZ3jpXXuN3Iop0Ka5N19eLNUO89gK1i3usuT3J7ak+U26BLUOsGwciqvuDEmXzhIDO65qQack0qCHfY056FOIBokYFjq/RZ22TIos4YgVIA9k1l2j+DIK7wFi2AoxxzyFYyhQEjWNzHWqtH3X8dZuspJY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SAZdFZDF; arc=none smtp.client-ip=209.85.161.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SAZdFZDF" Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5a05923b689so609119eaf.0 for ; Sun, 25 Feb 2024 19:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918656; x=1709523456; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WaxVF2qihSqzxGKZBvAzLfq40v5D1O6PnVhbmcqQkgw=; b=SAZdFZDFWNqpJ79yIBKmQ6KOg/UqI+f2Wp8uGTWWl4KEEGNd7gEyzIBqLxc33z2nUF IKuiW0T74BSysAXxOQf5KDIm2F7nXvCk0ZzmCPQ+foctt/xkHthUc0HJsG8UkT9WaXCO tlMR9HZ3GsyJYVJI8n/g+wfCPTnIuuhEe3pek06ICevc1Y9pwv9bdtmGBu43jsTZEInT drZqE0rIUnsM4VtQ3v8O6k9Wg4fZB7CBf14s7Z92g0CZLda04c/QVIZobIPXqp8Hu8U6 YzrxlkxOW/I5gydmVXguAUhEGb/c/oL3+B2GdvFKkTaX1QQJTZMHuEf2UVQ6V8Za+clB 866Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918656; x=1709523456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WaxVF2qihSqzxGKZBvAzLfq40v5D1O6PnVhbmcqQkgw=; b=JnViRg/+8ULH3D337qrERy/zEcU5rFUehb6I5TYhEAr1PZ6zk5sbzRpqfhsNSLcJpA VGDPThWyCXvmDWqSvOIb97aWnjwX5ZlGPnE30xgWs9OQKL0YqpT0a1AJjSfkXP9BsoE4 sFfAty78nCyQUsfPBKOS/mbiDQlrqM6kEVzQLXQItph8DeR9UIBPgWvJCerNp2gd5jc0 EtjOb9+bLpEtpkSep3CNapV6yhlnEeGc8oNbGKhWifC4e3ZK1yjv8c4EbW1XxeZhWxDk gVMS5Ox8YQlQuf0RPidx9gLRPJVYrG87+v0qSf/8Usj/MifoBzR157vbrQ3ysDjIMKUw putQ== X-Gm-Message-State: AOJu0YwBukEkodtlxAFjD3JXNzKazNKqie84T7c7yuF/6wZec240JQCc xDEq4ZdWLJOaZhWNbHSUY9OxOZRTRDt5I3Wugtqbkxu9Vc/EkXyhIB4hTleW X-Google-Smtp-Source: AGHT+IHBZuiSJKN/ioCuUryouoRw9cIDvQQ85zagMxWHTmv1tGRCGoUBHra0KjKc9JYAsCX3jxR7Fw== X-Received: by 2002:a4a:3542:0:b0:5a0:312f:e8b2 with SMTP id w2-20020a4a3542000000b005a0312fe8b2mr4984372oog.9.1708918655940; Sun, 25 Feb 2024 19:37:35 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:35 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 15/22] network: Remove use of g_strlcpy Date: Sun, 25 Feb 2024 21:36:58 -0600 Message-ID: <20240226033724.1460079-15-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strlcpy --- src/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network.c b/src/network.c index 347861046e1a..7516d9d00210 100644 --- a/src/network.c +++ b/src/network.c @@ -365,7 +365,7 @@ static char *get_operator_display_name(struct ofono_netreg *netreg) */ if (opd == NULL) { - g_strlcpy(name, "", len); + l_strlcpy(name, "", len); return name; } @@ -386,7 +386,7 @@ static char *get_operator_display_name(struct ofono_netreg *netreg) spn = ofono_sim_get_spn(netreg->sim); if (spn == NULL || strlen(spn) == 0) { - g_strlcpy(name, plmn, len); + l_strlcpy(name, plmn, len); return name; } From patchwork Mon Feb 26 03:36:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571237 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76A3F156CF for ; Mon, 26 Feb 2024 03:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918658; cv=none; b=IDIuLXLUJaK9XkilhSfk0Ul27ZHSoeXvrhm3Sf2dQbsx3Ce/Ux35bFvs6CK6KYDOVdUzGRwyNUxK4an8zYO9SSmJBPulYxkTTFc74CHx3gcTG4ISaO8k+Qc8QZGlM9ddLRRxll67fS3BBHcFGmKR7IKIPdzcWkHXpYNqnkoRoqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918658; c=relaxed/simple; bh=el/v/d/u2nff2/4kmJmXIENAdAGw7lh9zpCWD5BqNiI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XtTwrKdovx5FtxOg/6c6M9Hhg3AsU59f3rJdVB02WJOKIhhIBDB0MTFI1uffT9zRr6Ood6LOLtgQ7tsIImYWLoDm/1ZXPDKf94zPgBxCvnKW4wWt/cb2mbE9JbyamPvrfFQ6WuTUoGMtV6flWZXxWdVlb0DFiQrVpMO4jF6fSXk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U3hscdVa; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U3hscdVa" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3bb9d54575cso2237864b6e.2 for ; Sun, 25 Feb 2024 19:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918656; x=1709523456; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=07TpU/iSC0/2gSbP2kh/PzMpYLssOlwLYG7TgqJSn1I=; b=U3hscdVa7ZbFGVQoVA+qFt2/dd5IUKAS+lEnoflvTdgjg0j/I/SP/3HjLQeqZ2DPUj EjoabXd1iOZx012StLPmydVoXlchAwdNY/F3c1qifrVkEqA5ChyGVBzL4ziGuA8v/mxi oX//CshRFql8fNvMXfi16RHB8o0m5D8IUO87WChOfpphly6yS2pk+iJt4MbtzWlHvMIR SnXb42wSZ1OzpxmXrmlb3HzMvohPCRDpYAsN62n8pzxpziAlLFzOAQLNttbSU/wF6oMM O8D8+dYdxQC8AHVb0mif6Lo4gbHWNhn3L6SK5SYLndpV835Wq3cg7TVpO7ltyPi1Z/rI AkJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918656; x=1709523456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=07TpU/iSC0/2gSbP2kh/PzMpYLssOlwLYG7TgqJSn1I=; b=sKVYtjXBvSix5fpQoqKtHcYPAL2384v5RZBTObDM2alfs7dz0MVg+wFfVlbEzLbu2Q vG3TjaFMho5BpcbzBa6Xet+omS6cNwE4q6hq9upwdHqSfd2bENfXgwKHLTrKjFQgqR41 wPHabP8xxOKyI+FtGVWRJw1XR1I3qxFjz6LAPNc0piE+YXBF1+S/gh/SuGoZFOX1+JGn q6FW5uSk6Igll4iT9RKcO+q42N6NSoWElEV9MLsWr/oqEsTsGnKDu6HQqR3KqxAS3JyA ctDgdmn9t01TAkgrbCC4iA1A30x5HBwZ3V2NboOtvU2vC0PxC+Xvhnmn6vKkvwdgcPVw y+lQ== X-Gm-Message-State: AOJu0YwgriarD0wofYjdAw5X1buBg0Q9ZBPAOxwQZtYB2B0qPQzO3QZK pqWz05RI2QZ2LWhPEA+MyT467Ylwg5K1MRujoPQVlYJuvIr4KF1eLl5/8KRB X-Google-Smtp-Source: AGHT+IFJvfyZ8UgfjCOZA2UqPqEn+R68Fwe0YhrCmoMAVDDFhm9NqrqHJpI4DhKqZEs69OnGoCl5Bw== X-Received: by 2002:a05:6808:38c5:b0:3c1:a58d:6f53 with SMTP id el5-20020a05680838c500b003c1a58d6f53mr385012oib.45.1708918656641; Sun, 25 Feb 2024 19:37:36 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:36 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 16/22] simutil: Remove use of g_strlcpy Date: Sun, 25 Feb 2024 21:36:59 -0600 Message-ID: <20240226033724.1460079-16-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strlcpy --- src/simutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simutil.c b/src/simutil.c index 7345f38db571..a4a8f8c4b230 100644 --- a/src/simutil.c +++ b/src/simutil.c @@ -982,8 +982,8 @@ gboolean sim_spdi_lookup(struct sim_spdi *spdi, if (spdi == NULL) return FALSE; - g_strlcpy(spdi_op.mcc, mcc, sizeof(spdi_op.mcc)); - g_strlcpy(spdi_op.mnc, mnc, sizeof(spdi_op.mnc)); + l_strlcpy(spdi_op.mcc, mcc, sizeof(spdi_op.mcc)); + l_strlcpy(spdi_op.mnc, mnc, sizeof(spdi_op.mnc)); return g_slist_find_custom(spdi->operators, &spdi_op, spdi_operator_compare) != NULL; From patchwork Mon Feb 26 03:37:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571238 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13CAC14A85 for ; Mon, 26 Feb 2024 03:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918659; cv=none; b=PTJNCEkJV4W1Mxc4frq/Q87FJUiE/A7/P+TrLJKouzDyb0V87Rbl8+qlDZrMW+h4G8cveEADpb7L36NCigA/PBHSkMu/uG5Pv++r4sq9yGVHdZZLvCwRWnQmHbBz2fzyW6Xuil3X8pNOOfRnWNJbwvirboR/eCO0WTwYKPUpTDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918659; c=relaxed/simple; bh=2yn8lHT0yCW6AzzK8uZmtOpxGhAlY6jY1KJ657clvOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DCaqYl3hYGBtRWTNn/2hqALtBnubQvPM+Wpo0G0HfGsjnlQ2Wpv8q3QZ3ptS+1bCA5BPUu74yfyc3u7ihve9jb9nY7fjF9uOHdEpur2ChVNWUcUi0t5WQRh5BteSVruCJuiH4Ux6Vql6KXNzQww0Rmj+L/Zm7G+w282vQVk07pE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RCtKpBnb; arc=none smtp.client-ip=209.85.167.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RCtKpBnb" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3c0485fc8b8so1972012b6e.3 for ; Sun, 25 Feb 2024 19:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918657; x=1709523457; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=leh0DaqTdtkPfQXhaVyfFOJS6w0uROAGx+5ANr8wiN8=; b=RCtKpBnb4Luzk5mDQuQrGjdpXOCiXO1XIGn3T8JlcWE9QJozbPexi2wFrUCr7v/ku8 CvYbm9qa2QNLDGHouOy5MZ08/OQSeHl2dXt0oR9kOSQH/edh/npkF7MEQ6sJMTSNKvNJ R09Bk4ANI2YK0GsjblNf1efmaAQVFTfs5FCv4mdamN0+u6z2hw+O8K1IrZa5l7cudb5C VNBGzzte4hKQENC/rXK8IzBk5Nulp+1pMFzBGjOOY2dD135G2/E8lFYWwpIH4d7WWfRw XMQW4yVfgBvoBTMpe/QiP0NamBWyWq23t6lMFJYN6beIF4mPSr/fybSVVBWl0pk2qmB4 32sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918657; x=1709523457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=leh0DaqTdtkPfQXhaVyfFOJS6w0uROAGx+5ANr8wiN8=; b=vtKtPdBtQSSWMQBO3+g7U3T/JYi4+xoyGqvcfVlIhpLeNs6PA+JhNqYvrBa7ef5Aru m03zDf3iA2IDIF2w+g47FHeJxmSoSUTfSCQxFg0+9kJWuPj9HaR78z+xrkOT1mICEOdI uZvxbdSSAd34Xsb5PtRjXoaXn/rv+zNjShh5XxUq1Hh6AUlErF2uoFQODE/xH6iof3OT nP+3YPR7bkJF2PWk9zhDmQSMAzOenbRvPsWVhwWTJgXdT1zEvJIL3XNAlZOzNAsTb06u BMqgpUQHMd5sTRqUkE0q+TsjRlFnLNSQQytwoTcYixRyNaJQ/AkCSswJklm9PLsob3rX C6BQ== X-Gm-Message-State: AOJu0YwY7SxjmZAL3wHuUgssAbNNGJ6sX7S768OdXIugLl3gNh6ZK0qb DUkvnMQLz6LQb2nEpfiEPhSJlRXF/AaXCWpEAjc7NFgLbrSrSYzURGt5XmrV X-Google-Smtp-Source: AGHT+IH/qCknzdZ4O82u6CWh0pR/z9i66ffmhgR5rabZrlbUlOLHNrEI7jSPkUAVI9j4Kpaf4wArGA== X-Received: by 2002:a05:6808:482:b0:3c0:2bf5:7c11 with SMTP id z2-20020a056808048200b003c02bf57c11mr5997157oid.17.1708918657257; Sun, 25 Feb 2024 19:37:37 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:37 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 17/22] sim: Remove g_strdup use Date: Sun, 25 Feb 2024 21:37:00 -0600 Message-ID: <20240226033724.1460079-17-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by l_strdup --- src/sim.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sim.c b/src/sim.c index d941415a4879..50c6a46eebf7 100644 --- a/src/sim.c +++ b/src/sim.c @@ -515,15 +515,15 @@ static void pin_cache_update(const char *iccid, const char *pin) struct cached_pin *cpins; if (pin_cached != NULL) { - g_free(pin_cached->pin); - pin_cached->pin = g_strdup(pin); + l_free(pin_cached->pin); + pin_cached->pin = l_strdup(pin); return; } cpins = g_new0(struct cached_pin, 1); - cpins->id = g_strdup(iccid); - cpins->pin = g_strdup(pin); + cpins->id = l_strdup(iccid); + cpins->pin = l_strdup(pin); cached_pins = g_slist_prepend(cached_pins, cpins); } @@ -536,8 +536,8 @@ static void pin_cache_remove(const char *iccid) cached_pins = g_slist_remove(cached_pins, pin_cached); - g_free(pin_cached->pin); - g_free(pin_cached->id); + l_free(pin_cached->pin); + l_free(pin_cached->id); g_free(pin_cached); } @@ -1713,7 +1713,7 @@ static void sim_imsi_obtained(struct ofono_sim *sim, const char *imsi) DBusConnection *conn = ofono_dbus_get_connection(); const char *path = __ofono_atom_get_path(sim->atom); - sim->imsi = g_strdup(imsi); + sim->imsi = l_strdup(imsi); ofono_dbus_signal_property_changed(conn, path, OFONO_SIM_MANAGER_INTERFACE, @@ -2291,7 +2291,7 @@ static void sim_iccid_read_cb(int ok, int length, int record, extract_bcd_number(data, length, iccid); iccid[20] = '\0'; - sim->iccid = g_strdup(iccid); + sim->iccid = l_strdup(iccid); ofono_dbus_signal_property_changed(conn, path, OFONO_SIM_MANAGER_INTERFACE, @@ -2305,7 +2305,7 @@ static void sim_iccid_changed(int id, void *userdata) struct ofono_sim *sim = userdata; if (sim->iccid) { - g_free(sim->iccid); + l_free(sim->iccid); sim->iccid = NULL; } @@ -2590,7 +2590,7 @@ static void sim_inserted_update(struct ofono_sim *sim) static void sim_free_early_state(struct ofono_sim *sim) { if (sim->iccid) { - g_free(sim->iccid); + l_free(sim->iccid); sim->iccid = NULL; } @@ -2654,7 +2654,7 @@ static void aid_session_free(gpointer data) static void sim_free_main_state(struct ofono_sim *sim) { if (sim->imsi) { - g_free(sim->imsi); + l_free(sim->imsi); sim->imsi = NULL; } From patchwork Mon Feb 26 03:37:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571239 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D369B14008 for ; Mon, 26 Feb 2024 03:37:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918660; cv=none; b=fLLTlWVrp60wcLEXWmESqFrnIOcYn3tQxpXIu5v1+CxTDO+5Fa9SX17IoNVnmTzoZ5Vza+nGTBpBuGFE0EonubtB0WFxxXvdHvjqPWH0X2AzWYemDyx4EgJv3ohKpIG13RDyIWNfx7GppERquvdFPEwlZzlsaDPNWjg2WJTthyw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918660; c=relaxed/simple; bh=bQdIuuVwimIv7zgtEA07jGD5iMVZ0QRUodXVfrfDvLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fp1N59wn/7aSAy8yak6i8OE+XCW3wLQxZgP7t9TLDTXVr5gaxgGT4WBRJdv44SWZNZ507lUbuY+Bib/mNBgUHJo8dsxwOoyZiLbdZh32Z1oxZb9PipvuXdrMRYyANPISzXJgvbR0zH7BChibAmbnCcXUChOhi7fGpo+E9iWkow0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GTgL9Gyt; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GTgL9Gyt" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5a035a1124dso1003905eaf.1 for ; Sun, 25 Feb 2024 19:37:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918658; x=1709523458; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v9BJ7oLjhkTjF1ACuOM9MkDuvj49cSEOEc1hcNR4iAM=; b=GTgL9GytZKgICMZwcEWNLBGZzAaHWZXJ4iMc24BvVu+phWk8Yj4ECZAQmBJdTHznCW kuTInVIMDlLSpYKGnI518vgOh+cO1Ehl4CYCqeczwr5jusZHuhiGIk4VW8fmSZdstI+s TWokFoOjVzPH0qLhmFmifB11fXTATD0wtQgK0m6FBZat4Tb/w2hbbrmAHj8oX35bUB5Q 5xMILVzQWcPZt6N91Us+teurRoSPpZj9qmixp4LXO/fPzxNiS7IbU8NBU7t+wMrt3dIb g3y1TTfSilQ0+etnYG//ACYYyggMS8IiAqBD9Dy2376YdEsyrqA78BhI/EcnhIG36+7b PcKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918658; x=1709523458; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v9BJ7oLjhkTjF1ACuOM9MkDuvj49cSEOEc1hcNR4iAM=; b=FP8GFGvOzUmoq5BvpLO/qw5ss16gYEWYwpC9x+Z43Yjod9b3QWDys7Ny8OFjkokymx oEajkCKWis2toniOh835A7o66boZ6QESKbEadw7cZledTnLcbSMGe3rS8QMMPPi0hAr8 BX29kupLwqq//43aq7vfBx8bxx5aAQu9r3yF6E5XPHhk8hRc2lTK4dZpYrRXFKTwcYkM qHu7S+f7cwzMJS3YSWyJMKHHU6ZBEVZ1cGyJY8RTigiI8+oVJNyTQs1aIe4yHucKcL2v 4d3rjDplC/1bVKsz4Bd9VNw2AveuZye2oWDeKKnQwlbMNd3w/9mr2U4g+yvMRNZzDj31 Dr7w== X-Gm-Message-State: AOJu0YzFHSREEjeQ0pqAbwkrlcEGtuaqlwlJcvzwBYncEkN1Hxb+qp8S I/P00oh4MnLLCVtmKjRl1HfAgdATpyGJv9hvWF0IHTzcaaYBE9jtTTFx/IfT X-Google-Smtp-Source: AGHT+IGHIV4TxUYIZBrNf6GhAOxxCMJmutB5E1eTUCPbzKsnah6i2wHT7QVyumP+l4m38Wi4MFXj9w== X-Received: by 2002:a4a:6506:0:b0:5a0:3bbf:d4e7 with SMTP id y6-20020a4a6506000000b005a03bbfd4e7mr5302528ooc.6.1708918657885; Sun, 25 Feb 2024 19:37:37 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:37 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 18/22] modem: Drop g_strdup use Date: Sun, 25 Feb 2024 21:37:01 -0600 Message-ID: <20240226033724.1460079-18-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup --- src/modem.c | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/modem.c b/src/modem.c index c139fd1e1b53..788e86fba0f6 100644 --- a/src/modem.c +++ b/src/modem.c @@ -959,7 +959,7 @@ static void lockdown_remove(struct ofono_modem *modem) modem->lock_watch = 0; } - g_free(modem->lock_owner); + l_free(modem->lock_owner); modem->lock_owner = NULL; modem->lockdown = FALSE; @@ -1052,14 +1052,14 @@ static DBusMessage *set_property_lockdown(struct ofono_modem *modem, if (ofono_modem_get_emergency_mode(modem) == TRUE) return __ofono_error_emergency_active(msg); - modem->lock_owner = g_strdup(caller); + modem->lock_owner = l_strdup(caller); modem->lock_watch = g_dbus_add_disconnect_watch(conn, modem->lock_owner, lockdown_disconnect, modem, NULL); if (modem->lock_watch == 0) { - g_free(modem->lock_owner); + l_free(modem->lock_owner); modem->lock_owner = NULL; return __ofono_error_failed(msg); @@ -1352,12 +1352,12 @@ void ofono_modem_add_interface(struct ofono_modem *modem, const char *feature; modem->interface_list = g_slist_prepend(modem->interface_list, - g_strdup(interface)); + l_strdup(interface)); feature = get_feature(interface); if (feature) modem->feature_list = g_slist_prepend(modem->feature_list, - g_strdup(feature)); + l_strdup(feature)); if (modem->interface_update != 0) return; @@ -1379,7 +1379,7 @@ void ofono_modem_remove_interface(struct ofono_modem *modem, return; } - g_free(found->data); + l_free(found->data); modem->interface_list = g_slist_remove(modem->interface_list, found->data); @@ -1388,7 +1388,7 @@ void ofono_modem_remove_interface(struct ofono_modem *modem, found = g_slist_find_custom(modem->feature_list, feature, (GCompareFunc) strcmp); if (found) { - g_free(found->data); + l_free(found->data); modem->feature_list = g_slist_remove(modem->feature_list, found->data); @@ -1411,7 +1411,7 @@ static void query_svn_cb(const struct ofono_error *error, if (error->type != OFONO_ERROR_TYPE_NO_ERROR) return; - info->svn = g_strdup(svn); + info->svn = l_strdup(svn); ofono_dbus_signal_property_changed(conn, path, OFONO_MODEM_INTERFACE, "SoftwareVersionNumber", DBUS_TYPE_STRING, &info->svn); @@ -1435,7 +1435,7 @@ static void query_serial_cb(const struct ofono_error *error, if (error->type != OFONO_ERROR_TYPE_NO_ERROR) goto out; - info->serial = g_strdup(serial); + info->serial = l_strdup(serial); ofono_dbus_signal_property_changed(conn, path, OFONO_MODEM_INTERFACE, @@ -1463,7 +1463,7 @@ static void query_revision_cb(const struct ofono_error *error, if (error->type != OFONO_ERROR_TYPE_NO_ERROR) goto out; - info->revision = g_strdup(revision); + info->revision = l_strdup(revision); ofono_dbus_signal_property_changed(conn, path, OFONO_MODEM_INTERFACE, @@ -1494,7 +1494,7 @@ static void query_model_cb(const struct ofono_error *error, if (error->type != OFONO_ERROR_TYPE_NO_ERROR) goto out; - info->model = g_strdup(model); + info->model = l_strdup(model); ofono_dbus_signal_property_changed(conn, path, OFONO_MODEM_INTERFACE, @@ -1526,7 +1526,7 @@ static void query_manufacturer_cb(const struct ofono_error *error, if (error->type != OFONO_ERROR_TYPE_NO_ERROR) goto out; - info->manufacturer = g_strdup(manufacturer); + info->manufacturer = l_strdup(manufacturer); ofono_dbus_signal_property_changed(conn, path, OFONO_MODEM_INTERFACE, @@ -1646,19 +1646,19 @@ static void devinfo_unregister(struct ofono_atom *atom) { struct ofono_devinfo *info = __ofono_atom_get_data(atom); - g_free(info->manufacturer); + l_free(info->manufacturer); info->manufacturer = NULL; - g_free(info->model); + l_free(info->model); info->model = NULL; - g_free(info->revision); + l_free(info->revision); info->revision = NULL; - g_free(info->serial); + l_free(info->serial); info->serial = NULL; - g_free(info->svn); + l_free(info->svn); info->svn = NULL; } @@ -1725,7 +1725,7 @@ static int set_modem_property(struct ofono_modem *modem, const char *name, switch (type) { case PROPERTY_TYPE_STRING: - property->value = g_strdup((const char *) value); + property->value = l_strdup((const char *) value); break; case PROPERTY_TYPE_INTEGER: property->value = g_memdup2(value, sizeof(int)); @@ -1737,7 +1737,7 @@ static int set_modem_property(struct ofono_modem *modem, const char *name, break; } - g_hash_table_replace(modem->properties, g_strdup(name), property); + g_hash_table_replace(modem->properties, l_strdup(name), property); return 0; } @@ -1833,9 +1833,9 @@ void ofono_modem_set_powered_timeout_hint(struct ofono_modem *modem, void ofono_modem_set_name(struct ofono_modem *modem, const char *name) { if (modem->name) - g_free(modem->name); + l_free(modem->name); - modem->name = g_strdup(name); + modem->name = l_strdup(name); if (modem->driver) { DBusConnection *conn = ofono_dbus_get_connection(); @@ -1857,8 +1857,8 @@ void ofono_modem_set_driver(struct ofono_modem *modem, const char *type) if (strlen(type) > 16) return; - g_free(modem->driver_type); - modem->driver_type = g_strdup(type); + l_free(modem->driver_type); + modem->driver_type = l_strdup(type); } struct ofono_modem *ofono_modem_create(const char *name, const char *type) @@ -1887,10 +1887,10 @@ struct ofono_modem *ofono_modem_create(const char *name, const char *type) if (modem == NULL) return modem; - modem->path = g_strdup(path); - modem->driver_type = g_strdup(type); + modem->path = l_strdup(path); + modem->driver_type = l_strdup(type); modem->properties = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, unregister_property); + l_free, unregister_property); modem->timeout_hint = DEFAULT_POWERED_TIMEOUT; g_modem_list = g_slist_prepend(g_modem_list, modem); @@ -2052,7 +2052,7 @@ int ofono_modem_register(struct ofono_modem *modem) return -EIO; } - g_free(modem->driver_type); + l_free(modem->driver_type); modem->driver_type = NULL; modem->atom_watches = __ofono_watchlist_new(g_free); @@ -2102,10 +2102,10 @@ static void modem_unregister(struct ofono_modem *modem) modem->sim_watch = 0; modem->sim_ready_watch = 0; - g_slist_free_full(modem->interface_list, g_free); + g_slist_free_full(modem->interface_list, l_free); modem->interface_list = NULL; - g_slist_free_full(modem->feature_list, g_free); + g_slist_free_full(modem->feature_list, l_free); modem->feature_list = NULL; if (modem->timeout) { @@ -2158,9 +2158,9 @@ void ofono_modem_remove(struct ofono_modem *modem) g_modem_list = g_slist_remove(g_modem_list, modem); - g_free(modem->driver_type); - g_free(modem->name); - g_free(modem->path); + l_free(modem->driver_type); + l_free(modem->name); + l_free(modem->path); g_free(modem); } From patchwork Mon Feb 26 03:37:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571240 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D505156CF for ; Mon, 26 Feb 2024 03:37:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918661; cv=none; b=NKbvoRs+L7etkR7ctVdcDdAbtHbNcmu6GPRdDE4pgmZPHh9752LFWm64PJLPYwMvWbzJSc6ub8ucSAtD81AuXEkvZhbWuPohiR2U5IhoPjNVUlLjj5yJ77DEi3V6RScipsBmbL6s3dJKb/83OTEz6ew4SjIOr/UFCLjtIqdPMl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918661; c=relaxed/simple; bh=n7xeE47HaCDAr09gryBE8G9J7FI4XWFCiqgYpPSzg7M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l4okJKBL4Q8NElrJ7vSbCQkepM1No/4IA2rjYqlCoMxGSbkA3yGWRFSWaJ8lY4BJaH1v5lM/bW0sF9SSbfGhhCK/rw8o8QHP1sE4fU/KulR9i7Ig7NCwuNWItLaPJzoqSPNwjdXC7CJr2xcSYm3qpxno2qJcJEs8O9W5b8Yzyac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U9Sa6N3V; arc=none smtp.client-ip=209.85.167.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U9Sa6N3V" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3bbb4806f67so2079219b6e.3 for ; Sun, 25 Feb 2024 19:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918658; x=1709523458; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vV9GEjtnN5rEYNaT+uj9zxm84SvuBpr7nplYAoj6zKU=; b=U9Sa6N3VTtOUnQ2LhSdly2CGE4bHfrvGucmWRUhW5B+p5Wwspt1j26UyXzSCxtJG5w k1jcmNtB+QMskyNqwQywTfc7wdktuSFvAmodduQfas9J+o8DCc2V0t4SZjxZFZFOQlUa /sf9u9zZ/tP4WL2ghrJx+Pc/Zz1XQ+htUxndT309MfIEvGAH7XBNEM6iFt8wYjP7eQtx CO56K5NCJ3CdTuILeE0EZg7rrd47omLMjKStyA6fhwWyLQ0K0UJxDAhaChLe3iOYigS6 iR1wke3IWPSQ452vYKXvV/4P/PfcQwo17JybUNbuUcAdmw0LRhmQqH54aSks2TkTovAL djWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918658; x=1709523458; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vV9GEjtnN5rEYNaT+uj9zxm84SvuBpr7nplYAoj6zKU=; b=Ud2Fm2ePgn6v6P+YwtIJ5iJeeESNCde+AU5Hfk9Qbfz5A0uYsKCPrk/sbF9tx3JYtK FOsRurmgd0YGMHjPNaFmOaFvHO0D8HN+V0QHjzLn5pTTPAEJZ53oFPjWO8xHdhUGQ64P e7x8yRlYgVjouBAqPfSPGsJyUj5p7mjzM00s5q5d1kZQNIsgBqGYRc5i3NlBgysxAdrU BoqfDYkvR5psS0PwNgOH+tEnLk319HlQKcnZGvxXALxe0GkwbVK3eTEEebhkYBoa1fQV glPwmd0qNJZE3uosb5iXhFpDvEpOhmhC2rWBA1IkOS1D54rs45xhysQ/cIDs3jQJ5tUW bTrw== X-Gm-Message-State: AOJu0Yyng9BouK0PA8FtjQ+FgotVEIdLCPDF1xnKzSMRiTXwnUZyHHBL ccgdpbcaYSrxu4ClG1chNJvHjsa4+Z2al2acKPR32gG7Rz2swk8BM+o6IQ+V X-Google-Smtp-Source: AGHT+IFjgl2JtabY2aMQtmfz4laLpcE3S/HPmkBP0K6q09U+1vsvdMirYjKZPsxLR+fEcvrNEkzqaw== X-Received: by 2002:a05:6808:238b:b0:3c0:45ff:9614 with SMTP id bp11-20020a056808238b00b003c045ff9614mr7162632oib.7.1708918658457; Sun, 25 Feb 2024 19:37:38 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:38 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 19/22] gprs: Drop use of g_strdup Date: Sun, 25 Feb 2024 21:37:02 -0600 Message-ID: <20240226033724.1460079-19-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup --- src/gprs.c | 74 +++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index ae0d5ae8a387..9b5b5b16464d 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -325,19 +325,19 @@ static struct pri_context *gprs_context_by_path(struct ofono_gprs *gprs, static void context_settings_free(struct context_settings *settings) { if (settings->ipv4) { - g_free(settings->ipv4->ip); - g_free(settings->ipv4->netmask); - g_free(settings->ipv4->gateway); + l_free(settings->ipv4->ip); + l_free(settings->ipv4->netmask); + l_free(settings->ipv4->gateway); l_strfreev(settings->ipv4->dns); - g_free(settings->ipv4->proxy); + l_free(settings->ipv4->proxy); g_free(settings->ipv4); settings->ipv4 = NULL; } if (settings->ipv6) { - g_free(settings->ipv6->ip); - g_free(settings->ipv6->gateway); + l_free(settings->ipv6->ip); + l_free(settings->ipv6->gateway); l_strfreev(settings->ipv6->dns); g_free(settings->ipv6); @@ -544,7 +544,7 @@ static void pri_parse_proxy(struct pri_context *ctx, const char *proxy) { char *scheme, *host, *port, *path; - scheme = g_strdup(proxy); + scheme = l_strdup(proxy); if (scheme == NULL) return; @@ -558,7 +558,7 @@ static void pri_parse_proxy(struct pri_context *ctx, const char *proxy) else if (strcasecmp(scheme, "http") == 0) ctx->proxy_port = 80; else { - g_free(scheme); + l_free(scheme); return; } } else { @@ -581,10 +581,10 @@ static void pri_parse_proxy(struct pri_context *ctx, const char *proxy) } } - g_free(ctx->proxy_host); - ctx->proxy_host = g_strdup(host); + l_free(ctx->proxy_host); + ctx->proxy_host = l_strdup(host); - g_free(scheme); + l_free(scheme); } static void pri_ifupdown(const char *interface, ofono_bool_t active) @@ -727,7 +727,7 @@ static void pri_reset_context_settings(struct pri_context *ctx) if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS) { pri_set_ipv4_addr(interface, NULL); - g_free(ctx->proxy_host); + l_free(ctx->proxy_host); ctx->proxy_host = NULL; ctx->proxy_port = 0; } @@ -740,7 +740,7 @@ static void pri_update_mms_context_settings(struct pri_context *ctx) struct ofono_gprs_context *gc = ctx->context_driver; struct context_settings *settings = gc->settings; - settings->ipv4->proxy = g_strdup(ctx->message_proxy); + settings->ipv4->proxy = l_strdup(ctx->message_proxy); pri_parse_proxy(ctx, ctx->message_proxy); DBG("proxy %s port %u", ctx->proxy_host, ctx->proxy_port); @@ -1410,8 +1410,8 @@ static void pri_context_destroy(gpointer userdata) { struct pri_context *ctx = userdata; - g_free(ctx->proxy_host); - g_free(ctx->path); + l_free(ctx->proxy_host); + l_free(ctx->path); g_free(ctx); } @@ -1436,7 +1436,7 @@ static gboolean context_dbus_register(struct pri_context *ctx) return FALSE; } - ctx->path = g_strdup(path); + ctx->path = l_strdup(path); ctx->key = ctx->path + strlen(basepath) + 1; return TRUE; @@ -2193,7 +2193,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error, } /* Make a backup copy of path for signal emission below */ - path = g_strdup(ctx->path); + path = l_strdup(ctx->path); context_dbus_unregister(ctx); gprs->contexts = g_slist_remove(gprs->contexts, ctx); @@ -2205,7 +2205,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error, g_dbus_emit_signal(conn, atompath, OFONO_CONNECTION_MANAGER_INTERFACE, "ContextRemoved", DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); - g_free(path); + l_free(path); } static DBusMessage *gprs_remove_context(DBusConnection *conn, @@ -2502,7 +2502,7 @@ static void remove_non_active_context(struct ofono_gprs *gprs, } /* Make a backup copy of path for signal emission below */ - path = g_strdup(ctx->path); + path = l_strdup(ctx->path); context_dbus_unregister(ctx); gprs->contexts = g_slist_remove(gprs->contexts, ctx); @@ -2511,7 +2511,7 @@ static void remove_non_active_context(struct ofono_gprs *gprs, g_dbus_emit_signal(conn, atompath, OFONO_CONNECTION_MANAGER_INTERFACE, "ContextRemoved", DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); - g_free(path); + l_free(path); } static DBusMessage *gprs_reset_contexts(DBusConnection *conn, @@ -2816,7 +2816,7 @@ static void gprs_context_remove(struct ofono_atom *atom) if (gc->driver && gc->driver->remove) gc->driver->remove(gc); - g_free(gc->interface); + l_free(gc->interface); g_free(gc); } @@ -2869,8 +2869,8 @@ const char *ofono_gprs_context_get_interface(struct ofono_gprs_context *gc) void ofono_gprs_context_set_interface(struct ofono_gprs_context *gc, const char *interface) { - g_free(gc->interface); - gc->interface = g_strdup(interface); + l_free(gc->interface); + gc->interface = l_strdup(interface); } void ofono_gprs_context_set_ipv4_address(struct ofono_gprs_context *gc, @@ -2882,8 +2882,8 @@ void ofono_gprs_context_set_ipv4_address(struct ofono_gprs_context *gc, if (settings->ipv4 == NULL) return; - g_free(settings->ipv4->ip); - settings->ipv4->ip = g_strdup(address); + l_free(settings->ipv4->ip); + settings->ipv4->ip = l_strdup(address); settings->ipv4->static_ip = static_ip; } @@ -2895,8 +2895,8 @@ void ofono_gprs_context_set_ipv4_netmask(struct ofono_gprs_context *gc, if (settings->ipv4 == NULL) return; - g_free(settings->ipv4->netmask); - settings->ipv4->netmask = g_strdup(netmask); + l_free(settings->ipv4->netmask); + settings->ipv4->netmask = l_strdup(netmask); } void ofono_gprs_context_set_ipv4_prefix_length(struct ofono_gprs_context *gc, @@ -2909,7 +2909,7 @@ void ofono_gprs_context_set_ipv4_prefix_length(struct ofono_gprs_context *gc, if (settings->ipv4 == NULL) return; - g_free(settings->ipv4->netmask); + l_free(settings->ipv4->netmask); memset(&ipv4, 0, sizeof(ipv4)); @@ -2917,7 +2917,7 @@ void ofono_gprs_context_set_ipv4_prefix_length(struct ofono_gprs_context *gc, ipv4.s_addr = htonl(~((1 << (32 - length)) - 1)); inet_ntop(AF_INET, &ipv4, buf, sizeof(buf)); - settings->ipv4->netmask = g_strdup(buf); + settings->ipv4->netmask = l_strdup(buf); } void ofono_gprs_context_set_ipv4_gateway(struct ofono_gprs_context *gc, @@ -2928,8 +2928,8 @@ void ofono_gprs_context_set_ipv4_gateway(struct ofono_gprs_context *gc, if (settings->ipv4 == NULL) return; - g_free(settings->ipv4->gateway); - settings->ipv4->gateway = g_strdup(gateway); + l_free(settings->ipv4->gateway); + settings->ipv4->gateway = l_strdup(gateway); } void ofono_gprs_context_set_ipv4_dns_servers(struct ofono_gprs_context *gc, @@ -2952,8 +2952,8 @@ void ofono_gprs_context_set_ipv6_address(struct ofono_gprs_context *gc, if (settings->ipv6 == NULL) return; - g_free(settings->ipv6->ip); - settings->ipv6->ip = g_strdup(address); + l_free(settings->ipv6->ip); + settings->ipv6->ip = l_strdup(address); } void ofono_gprs_context_set_ipv6_prefix_length(struct ofono_gprs_context *gc, @@ -2975,8 +2975,8 @@ void ofono_gprs_context_set_ipv6_gateway(struct ofono_gprs_context *gc, if (settings->ipv6 == NULL) return; - g_free(settings->ipv6->gateway); - settings->ipv6->gateway = g_strdup(gateway); + l_free(settings->ipv6->gateway); + settings->ipv6->gateway = l_strdup(gateway); } void ofono_gprs_context_set_ipv6_dns_servers(struct ofono_gprs_context *gc, @@ -2999,7 +2999,7 @@ static void free_contexts(struct ofono_gprs *gprs) storage_close(gprs->imsi, SETTINGS_STORE, gprs->settings, TRUE); - g_free(gprs->imsi); + l_free(gprs->imsi); gprs->imsi = NULL; gprs->settings = NULL; } @@ -3266,7 +3266,7 @@ static void gprs_load_settings(struct ofono_gprs *gprs, const char *imsi) if (gprs->settings == NULL) return; - gprs->imsi = g_strdup(imsi); + gprs->imsi = l_strdup(imsi); error = NULL; gprs->powered = g_key_file_get_boolean(gprs->settings, SETTINGS_GROUP, From patchwork Mon Feb 26 03:37:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571241 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31E0E14A85 for ; Mon, 26 Feb 2024 03:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918661; cv=none; b=RFC5NeIvyZ3RWryxyLcRB4uWnDG+81AuBA3EV/mYOJf7nyXkDSUTOthBuD3HjTeA7K4fqucPH8YCjlnsNjVHhUpyePH4lvE0Xi9aKrK2V9HB4bW8rt03HWQyOUZIadCYdli0RAX5dGseOmq5z5SqLj3fdbeNJ6sUinirdbDVtVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918661; c=relaxed/simple; bh=853e0YTrzBxFVNKOal1wjGuQymxmWzwwLXGn6lxxpcM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sLtA9+r8ITFH3M7/TN8AHoPY3ds9zsHQkbYeG83UxY7M8NEHJYysHpjBefFSkAjPErt4+L4YDTJviaML1TOW1qznwHnCi90/hQry4jEj3tSB7nckQj8GYbNliemG+2mKjGXvCeOe0XBHuAk5stOrgYlWeu+cHm8O081g1n34uEo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hYlOwxXo; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hYlOwxXo" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3bbbc6e51d0so2283912b6e.3 for ; Sun, 25 Feb 2024 19:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918659; x=1709523459; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FNTikR/JRjgVCaEx1lI68Gv+EHJDEgHAwWpfcRYSlto=; b=hYlOwxXoGplCyXvI3o6IAXTf97qqhQvsvipnM7FpDoGAoa0rrlpVEVDf9Ft55opn4j rKNt3chTbOgBc7g1nTCYl5+K7p0qn7M46Ku6mJEtH8dxN46Fq8tKr4RRJnUPDWP3Vono vpmOUHwWyJL+KcGXCfwvjA2VuL+5lKv11JHt+vVVamqCLL4V+GIGoBDeRqCNTQsaR4zT t74id+T7aE6lYtrjIyaXqG1aozrF/pSQjUtKJrz3sPr3vzTWHVKV7umcQTkK+OrKeJF2 uD30WStgSJv+hb8I14ryAHJlI9FlXfOK+2kozUdXi6vy4mTFKjDdWs66YU65CiRMJOMv Rakg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918659; x=1709523459; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FNTikR/JRjgVCaEx1lI68Gv+EHJDEgHAwWpfcRYSlto=; b=pUt4uGONy16du4PV3QtoMUlNsTlJKegIW3clyc8YjREFAaymtZ8TupQ/cWgrhFLe5r 5ROx1pL7NFqMXXdGuYcnZt3OfFIapXiCqtI5mGsEpfxVra9+UkieWtG8of2tz+S8SpNy qwfnmlpZQ65UcvgJW8eO00o2moDj5amfnpoN4RdGu9LtR8hwfIkM3cWGlC3U/LId85Qi j6Z3ALXfCcgzi8BJ5rWfHBzYwiHugBmUQ6zjG/7dU0VYGUOsQg8BIearCPuONAi53Lkj BzDEhPSiHqNYEcLqCcvU4Ym6TFzM6rgLsmM/CX9iVX1Prqa8qTE8rsmfD4jLWmMPkSRy Q1gw== X-Gm-Message-State: AOJu0Yxb+NTSbVJNpSS+PlqMfxJxWNAXpx6AjDN2Jdf6oi2IJSmSpxxm rR/Ptk742FAKBK7UMhbYszBsAnIlum3owzl2V8OjTk9NIzq8liVStx7A4HfY X-Google-Smtp-Source: AGHT+IHTDe3N5oRFnllLyeI1+cyLWjuSn7382KBPGz/c3CRTztgIn9zvfEWtb9zqq7rhkShEltuo4w== X-Received: by 2002:aca:2812:0:b0:3c0:3266:d87c with SMTP id 18-20020aca2812000000b003c03266d87cmr5638289oix.45.1708918659231; Sun, 25 Feb 2024 19:37:39 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:39 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 20/22] network: Drop g_strdup use Date: Sun, 25 Feb 2024 21:37:03 -0600 Message-ID: <20240226033724.1460079-20-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace by l_strdup --- src/network.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/network.c b/src/network.c index 7516d9d00210..fda19a24bfe5 100644 --- a/src/network.c +++ b/src/network.c @@ -1124,21 +1124,12 @@ void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg, if (netreg->base_station == NULL && name == NULL) return; - if (netreg->base_station) - g_free(netreg->base_station); - - if (name == NULL) { - netreg->base_station = NULL; + l_free(netreg->base_station); + netreg->base_station = l_strdup(name); - /* - * We just got unregistered, set name to NULL - * but don't emit signal - */ - if (netreg->current_operator == NULL) - return; - } else { - netreg->base_station = g_strdup(name); - } + /* We just got unregistered, set name to NULL, but don't emit signal */ + if (!name && !netreg->current_operator) + return; ofono_dbus_signal_property_changed(conn, path, OFONO_NETWORK_REGISTRATION_INTERFACE, @@ -1790,16 +1781,14 @@ static void netreg_unregister(struct ofono_atom *atom) g_slist_free(netreg->operator_list); netreg->operator_list = NULL; - if (netreg->base_station) { - g_free(netreg->base_station); - netreg->base_station = NULL; - } + l_free(netreg->base_station); + netreg->base_station = NULL; if (netreg->settings) { storage_close(netreg->imsi, SETTINGS_STORE, netreg->settings, TRUE); - g_free(netreg->imsi); + l_free(netreg->imsi); netreg->imsi = NULL; netreg->settings = NULL; } @@ -1864,7 +1853,7 @@ static void netreg_load_settings(struct ofono_netreg *netreg) if (netreg->settings == NULL) return; - netreg->imsi = g_strdup(imsi); + netreg->imsi = l_strdup(imsi); strmode = g_key_file_get_string(netreg->settings, SETTINGS_GROUP, "Mode", NULL); From patchwork Mon Feb 26 03:37:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571242 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1042814008 for ; Mon, 26 Feb 2024 03:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918662; cv=none; b=gO2Z5emaExEjZH/4UWeW8aWgPg6v/GBZ4Q/nx3hcA5vQOXZh2f4Awcu3/Iwcuk9Wh/SWDqv+KVgaF0OjNWskEVXrJQ/ziZmdnpqA9wMGR+brAG/P2HggJnR8XybmPfFGhZDihVAMWAD1HZPAG4ZfWujCOqQBTkzmFxymNa83zWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918662; c=relaxed/simple; bh=11P2oredsF+yUwdvM/TKGuixsdJi1fMi7rABCm1N5EM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dk3KYpYOT2vZ4r8SnRAxX8w7lUtuAHSlNwA9T0d1yjOKCXVWxBf0hWCgkzxnb1DhLjDsHgLuQoj0kyk8ctBDpDZtvgqGBQwFMRfTu8YrwHR9eFq845Bk3c5v3x1e7b3VaSzj7BU9VNDnkvhWCRsTrDFLijCX8yL9xzltVqyCetY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VmhGFYVp; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VmhGFYVp" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3c1a1e1e539so550835b6e.1 for ; Sun, 25 Feb 2024 19:37:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918660; x=1709523460; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tv1gqC2kJaY7yJt4YSIu2jLBteRfGngAD12zojg11lw=; b=VmhGFYVpDq1NOSNkOo2CT0VVZDa8kBcDSByfsz4a2AOR3C/aZO9Vlcl4rmpKg4Yyu7 bDyZx9Jzkwm1+gu81yWBM/svNdC4KBW97zqJD1zf4nmFLOr0p2j3WCRmGLlnOPy6ck9X qvfwbRdFMbPTMcBp1Ogjpwb4gxKkl5yBhxeV9+iCvpInQVrl4WsOT7nEO423aJUnglgT ipBPolrngfpJOmk92ouBKOx8JNViIZsRUWxsaJKxcvkNPP9ONNVm3M026H8te2u+K1Zm 7TArHukTJHhIqiCsXxAW81Z3Tu1MnDBTsdu53Fxf5xKJMmoYNAL7ARZ53gE3aI/mrRDG LDhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918660; x=1709523460; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tv1gqC2kJaY7yJt4YSIu2jLBteRfGngAD12zojg11lw=; b=Emi2Pyv4SUBPPJrDTkXyrISGBdQG9LDpGFqmXB6b60x4lVvYjxMU505YIK5BrLW0h+ rlWZFjssZ6NgPuprM1OI3aM51Duh0NW8x56qicAORbY6KmyIxLB8ed7tiWXl8n+S9GRo 0+2CZ+SqAMjdtm7X01+6WaVCQFRKg26goN1ZsHkbHP4Qxd/2MF2fxztFHEtzQlcw/yzH 33eO2TmQxCpdn0KRn28sMBBiuGFmNTGTj3RkAYtPTlmAdVY+szp7UKWgadtz3EDjJ9j7 2XiWCEbkJ6qF6Yhvc/E3T2lktYaYd3WbMEyQzYVgkxsUdoE7lDfqUyRYdWmHCegk2+Ca 7Vqg== X-Gm-Message-State: AOJu0YzBiMDL9sctCfLnAyXImhVOGONcaCCdaPQbeE37ZprCpYFKa2YJ 9KAJJEA2FoJ5MaiBDx8qUiqz/DOI/Lt2s2AdSWURCV1CGAzMbc2/Q25cICZg X-Google-Smtp-Source: AGHT+IE16Gbot7T2VXJZenTTM4IrcTxi5mGl3OkvD/8K20JJVQSr0NOXL+q1mADzZMBH0/QvIx3Mlw== X-Received: by 2002:a54:4003:0:b0:3c1:8dcb:bdbb with SMTP id x3-20020a544003000000b003c18dcbbdbbmr6633905oie.20.1708918659916; Sun, 25 Feb 2024 19:37:39 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:39 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 21/22] voicecall: Drop use of g_strdup Date: Sun, 25 Feb 2024 21:37:04 -0600 Message-ID: <20240226033724.1460079-21-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup --- src/voicecall.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 6882153aa671..fb211b48e2f2 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -160,7 +160,7 @@ static void add_to_en_list(struct ofono_voicecall *vc, char **list) int i = 0; while (list[i]) - g_hash_table_insert(vc->en_list, g_strdup(list[i++]), NULL); + g_hash_table_insert(vc->en_list, l_strdup(list[i++]), NULL); } static const char *disconnect_reason_to_string(enum ofono_disconnect_reason r) @@ -302,7 +302,7 @@ static void dial_request_finish(struct ofono_voicecall *vc) dial_req->cb(dial_req->call ? dial_req->call->call : NULL, dial_req->user_data); - g_free(dial_req->message); + l_free(dial_req->message); g_free(dial_req); vc->dial_req = NULL; } @@ -354,7 +354,7 @@ static int tone_queue(struct ofono_voicecall *vc, const char *tone_str, if (entry == NULL) return -ENOMEM; - entry->tone_str = g_strdup(tone_str); + entry->tone_str = l_strdup(tone_str); entry->left = entry->tone_str; entry->cb = cb; entry->user_data = data; @@ -381,7 +381,7 @@ static void tone_request_finish(struct ofono_voicecall *vc, if (entry->destroy) entry->destroy(entry->user_data); - g_free(entry->tone_str); + l_free(entry->tone_str); g_free(entry); } @@ -688,7 +688,7 @@ static void voicecall_destroy(gpointer userdata) struct voicecall *voicecall = (struct voicecall *)userdata; g_free(voicecall->call); - g_free(voicecall->message); + l_free(voicecall->message); g_free(voicecall); } @@ -2623,7 +2623,7 @@ static void set_new_ecc(struct ofono_voicecall *vc) g_hash_table_destroy(vc->en_list); vc->en_list = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, NULL); + l_free, NULL); /* Emergency numbers from modem/network */ if (vc->nw_en_list) @@ -2634,7 +2634,7 @@ static void set_new_ecc(struct ofono_voicecall *vc) GSList *l; for (l = vc->sim_en_list; l; l = l->next) - g_hash_table_insert(vc->en_list, g_strdup(l->data), + g_hash_table_insert(vc->en_list, l_strdup(l->data), NULL); } else add_to_en_list(vc, (char **) default_en_list_no_sim); @@ -2653,7 +2653,7 @@ static void free_sim_ecc_numbers(struct ofono_voicecall *vc, gboolean old_only) */ if (old_only == FALSE) { if (vc->new_sim_en_list) { - g_slist_free_full(vc->new_sim_en_list, g_free); + g_slist_free_full(vc->new_sim_en_list, l_free); vc->new_sim_en_list = NULL; } @@ -2661,7 +2661,7 @@ static void free_sim_ecc_numbers(struct ofono_voicecall *vc, gboolean old_only) } if (vc->sim_en_list) { - g_slist_free_full(vc->sim_en_list, g_free); + g_slist_free_full(vc->sim_en_list, l_free); vc->sim_en_list = NULL; } } @@ -2692,7 +2692,7 @@ static void ecc_g2_read_cb(int ok, int total_length, int record, if (en[0] != '\0') vc->sim_en_list = g_slist_prepend(vc->sim_en_list, - g_strdup(en)); + l_strdup(en)); } vc->flags |= VOICECALL_FLAG_SIM_ECC_READY; @@ -2723,7 +2723,7 @@ static void ecc_g3_read_cb(int ok, int total_length, int record, if (en[0] != '\0') vc->new_sim_en_list = g_slist_prepend(vc->new_sim_en_list, - g_strdup(en)); + l_strdup(en)); if (record != total) return; @@ -2827,7 +2827,7 @@ static void voicecall_load_settings(struct ofono_voicecall *vc) if (vc->settings == NULL) return; - vc->imsi = g_strdup(imsi); + vc->imsi = l_strdup(imsi); } static void voicecall_close_settings(struct ofono_voicecall *vc) @@ -2835,7 +2835,7 @@ static void voicecall_close_settings(struct ofono_voicecall *vc) if (vc->settings) { storage_close(vc->imsi, SETTINGS_STORE, vc->settings, TRUE); - g_free(vc->imsi); + l_free(vc->imsi); vc->imsi = NULL; vc->settings = NULL; } @@ -3657,7 +3657,7 @@ void ofono_voicecall_register(struct ofono_voicecall *vc) ofono_modem_add_interface(modem, OFONO_VOICECALL_MANAGER_INTERFACE); vc->en_list = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, NULL); + l_free, NULL); /* * Start out with the 22.101 mandated numbers, if we have a SIM and @@ -3838,7 +3838,7 @@ int __ofono_voicecall_dial(struct ofono_voicecall *vc, if (req == NULL) return -ENOMEM; - req->message = g_strdup(message); + req->message = l_strdup(message); req->icon_id = icon_id; req->interaction = interaction; req->cb = cb; @@ -4003,7 +4003,7 @@ void __ofono_voicecall_set_alpha_and_icon_id(struct ofono_voicecall *vc, req = g_new0(struct dial_request, 1); - req->message = g_strdup(message); + req->message = l_strdup(message); req->icon_id = icon_id; req->ph.type = addr_type; @@ -4021,7 +4021,7 @@ void __ofono_voicecall_clear_alpha_and_icon_id(struct ofono_voicecall *vc) DBG("%p, %p", vc, vc->dial_req); if (vc->dial_req) { - g_free(vc->dial_req->message); + l_free(vc->dial_req->message); vc->dial_req->message = NULL; g_free(vc->dial_req); From patchwork Mon Feb 26 03:37:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13571243 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8261A156CF for ; Mon, 26 Feb 2024 03:37:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918663; cv=none; b=FyQE4Vd2YjFHS/JmSgloNNnhP39e48W9yyFVnsbfMsuLsr5lNETYV9d2Gf5wWiq9LB8L2OWlZjBtBJZDaYBJ6IWBUvS8FIP4v6iyj2r0CctzGItS5wepc7djHMESn7zdrb6eLJ/iA/9ggIZrTQarnV/iyD3vIOaKXeFG/ojPlHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708918663; c=relaxed/simple; bh=80EkPlXIo1lj6NonOh5H46XKPYVX0mbE5w8HXzAAqxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PPc199oUt3ObpBxxwNZXg0BssgLGw0D6g+zER8UGB6JgNoE5X4qD/7TjvXVlnQcPbwDk4/d2tbc0T016rPC8uXd4X9x7DsG7W91lX8+ArKWOKsupNNcWpViEOpbejHXT1o6d4DbreinR4Maek+odRKaPK+ymr1x0gQUSV8aYnz0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HA52ko1M; arc=none smtp.client-ip=209.85.210.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HA52ko1M" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6ddca59e336so1596478a34.0 for ; Sun, 25 Feb 2024 19:37:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708918660; x=1709523460; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7pphoeplo09GEg01P26kIC5z4xTPHi39OnvFelDXjgQ=; b=HA52ko1MwoAlVjYq/kyHKgzKjimz87II63XerLrRxMgKCjVLSggWahZ9DGNqgPal7B kcKcgLSJqloGmsUrF5T5OSGynoyNRc5ht6VwS0ODfIp3/lqFT/m8fX1q/td4Ktmn24rn /HL6xhVyvRBuAD0L5PANQfs5K1/qnFV7ZZzvpi2xZijMaJzBio8YjzA/5xqHTOA6m5dN wkXh6lfQEsvo3i0HXET3MUZnVv/td0s1TgC7whl6jI8UIbkuCv5jr2lkTYy+J40OLdPO sSc6PUeaIz1Xr7nBY/7BqiK+/C7Xe1TkNNbotc0TWv8Ej4P9O2jslJ/ige6SpbY7IzXO VESw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708918660; x=1709523460; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7pphoeplo09GEg01P26kIC5z4xTPHi39OnvFelDXjgQ=; b=l7sDxZCW73M/j0T80kerqg0KLkoMImIrMBiBGVD4L3z8V30j8FIZFJeMcdfV4j+tDu 0rtb8SwFw6ApZScVz9dpJXWG0je1xzCcjLhPJMzyEtXIb8H7Wvn0Fek27CWZf5TUTAzy aQVpV+SackXXmWss+EOMJ5cC44+236Jy8JF6pAOaX7JYP3Nq1t3YcRXpo3MzA4je0Jcu 3wb3xmaQPOtH0z0991TIUTkOBGwk8u9j5V+nwuJ3QBT19Vu0TDsOapGFt3mVdncFRyda f1hggr9R4KxhoSgaDrGxDd4Q6zNX/5RI/r1LFS4Cvj/wuNTSMJYyxxYP73hDGpZeN9Ye 3Cmg== X-Gm-Message-State: AOJu0Yyclk7mimNotL1FKXLj7VC06ygFsQvONr22JFaNL+taVUclBei2 V0vKL2Vn1y1c6O8uV3RkZrQ+RkMfgtJMUoAtZX0Xmw6kHva9oag91J3CYsCJ X-Google-Smtp-Source: AGHT+IF/gAGOO5Ip5yHE4tk2uy61q7lcBl7W/AGOcxRXEmQm4Tny3bNnYaekogZRgLCEeQuyQ7KH+g== X-Received: by 2002:a05:6830:650e:b0:6e4:926f:5f78 with SMTP id cm14-20020a056830650e00b006e4926f5f78mr2047445otb.10.1708918660559; Sun, 25 Feb 2024 19:37:40 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id fu27-20020a0568082a7b00b003c18c8be348sm951160oib.29.2024.02.25.19.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:37:40 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 22/22] core: Drop g_strdup use Date: Sun, 25 Feb 2024 21:37:05 -0600 Message-ID: <20240226033724.1460079-22-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240226033724.1460079-1-denkenz@gmail.com> References: <20240226033724.1460079-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_strdup --- src/audio-settings.c | 6 +++--- src/cbs.c | 4 ++-- src/emulator.c | 4 ++-- src/gnssagent.c | 8 ++++---- src/handsfree-audio.c | 28 ++++++++++++---------------- src/location-reporting.c | 4 ++-- src/netmonagent.c | 8 ++++---- src/phonebook.c | 12 ++++++------ src/radio-settings.c | 4 ++-- src/sms.c | 4 ++-- src/smsagent.c | 12 ++++++------ src/stkagent.c | 8 ++++---- src/ussd.c | 8 ++++---- 13 files changed, 53 insertions(+), 57 deletions(-) diff --git a/src/audio-settings.c b/src/audio-settings.c index 24c4213a1b82..99dabf26a214 100644 --- a/src/audio-settings.c +++ b/src/audio-settings.c @@ -68,8 +68,8 @@ void ofono_audio_settings_mode_notify(struct ofono_audio_settings *as, DBG("mode %s", mode); - g_free(as->mode); - as->mode = g_strdup(mode); + l_free(as->mode); + as->mode = l_strdup(mode); if (as->mode == NULL) return; @@ -151,7 +151,7 @@ static void audio_settings_remove(struct ofono_atom *atom) if (as->driver && as->driver->remove) as->driver->remove(as); - g_free(as->mode); + l_free(as->mode); g_free(as); } diff --git a/src/cbs.c b/src/cbs.c index 2c45330130a0..684463674297 100644 --- a/src/cbs.c +++ b/src/cbs.c @@ -602,7 +602,7 @@ static void cbs_unregister(struct ofono_atom *atom) if (cbs->settings) { storage_close(cbs->imsi, SETTINGS_STORE, cbs->settings, TRUE); - g_free(cbs->imsi); + l_free(cbs->imsi); cbs->imsi = NULL; cbs->settings = NULL; } @@ -868,7 +868,7 @@ static void cbs_got_imsi(struct ofono_cbs *cbs) if (cbs->settings == NULL) return; - cbs->imsi = g_strdup(imsi); + cbs->imsi = l_strdup(imsi); cbs->topics = NULL; diff --git a/src/emulator.c b/src/emulator.c index b3afb3da6de3..2d7475988580 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -1138,7 +1138,7 @@ static void emulator_add_indicator(struct ofono_emulator *em, const char* name, return; } - ind->name = g_strdup(name); + ind->name = l_strdup(name); ind->min = min; ind->max = max; ind->value = dflt; @@ -1163,7 +1163,7 @@ static void emulator_unregister(struct ofono_atom *atom) for (l = em->indicators; l; l = l->next) { struct indicator *ind = l->data; - g_free(ind->name); + l_free(ind->name); g_free(ind); } diff --git a/src/gnssagent.c b/src/gnssagent.c index f370dec835fe..cb27917296f1 100644 --- a/src/gnssagent.c +++ b/src/gnssagent.c @@ -113,8 +113,8 @@ void gnss_agent_free(struct gnss_agent *agent) if (agent->removed_cb) agent->removed_cb(agent->removed_data); - g_free(agent->path); - g_free(agent->bus); + l_free(agent->path); + l_free(agent->bus); g_free(agent); } @@ -135,8 +135,8 @@ struct gnss_agent *gnss_agent_new(const char *path, const char *sender) if (agent == NULL) return NULL; - agent->path = g_strdup(path); - agent->bus = g_strdup(sender); + agent->path = l_strdup(path); + agent->bus = l_strdup(sender); agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender, gnss_agent_disconnect_cb, diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c index a5d3a652af20..a739a5271d7d 100644 --- a/src/handsfree-audio.c +++ b/src/handsfree-audio.c @@ -465,10 +465,8 @@ void *ofono_handsfree_card_get_data(struct ofono_handsfree_card *card) void ofono_handsfree_card_set_remote(struct ofono_handsfree_card *card, const char *remote) { - if (card->remote) - g_free(card->remote); - - card->remote = g_strdup(remote); + l_free(card->remote); + card->remote = l_strdup(remote); } const char *ofono_handsfree_card_get_remote(struct ofono_handsfree_card *card) @@ -479,10 +477,8 @@ const char *ofono_handsfree_card_get_remote(struct ofono_handsfree_card *card) void ofono_handsfree_card_set_local(struct ofono_handsfree_card *card, const char *local) { - if (card->local) - g_free(card->local); - - card->local = g_strdup(local); + l_free(card->local); + card->local = l_strdup(local); } const char *ofono_handsfree_card_get_local(struct ofono_handsfree_card *card) @@ -581,7 +577,7 @@ int ofono_handsfree_card_register(struct ofono_handsfree_card *card) next_card_id += 1; - card->path = g_strdup(path); + card->path = l_strdup(path); emit_card_added(card); return 0; @@ -606,7 +602,7 @@ static void card_unregister(struct ofono_handsfree_card *card) emit_card_removed(card); - g_free(card->path); + l_free(card->path); card->path = NULL; } @@ -622,8 +618,8 @@ void ofono_handsfree_card_remove(struct ofono_handsfree_card *card) card_list = g_slist_remove(card_list, card); - g_free(card->remote); - g_free(card->local); + l_free(card->remote); + l_free(card->local); if (card->driver && card->driver->remove) card->driver->remove(card); @@ -663,8 +659,8 @@ static void agent_free(struct agent *agent) if (agent->watch > 0) g_dbus_remove_watch(ofono_dbus_get_connection(), agent->watch); - g_free(agent->owner); - g_free(agent->path); + l_free(agent->owner); + l_free(agent->path); g_free(agent); } @@ -789,8 +785,8 @@ static DBusMessage *am_agent_register(DBusConnection *conn, } agent = g_new0(struct agent, 1); - agent->owner = g_strdup(sender); - agent->path = g_strdup(path); + agent->owner = l_strdup(sender); + agent->path = l_strdup(path); agent->watch = g_dbus_add_disconnect_watch(conn, sender, agent_disconnect, NULL, NULL); diff --git a/src/location-reporting.c b/src/location-reporting.c index e9624309154b..412adbdf5166 100644 --- a/src/location-reporting.c +++ b/src/location-reporting.c @@ -100,7 +100,7 @@ static void client_remove(struct ofono_location_reporting *lr) lr->disconnect_watch = 0; } - g_free(lr->client_owner); + l_free(lr->client_owner); } static void signal_enabled(const struct ofono_location_reporting *lr) @@ -178,7 +178,7 @@ static void location_reporting_enable_cb(const struct ofono_error *error, } lr->enabled = TRUE; - lr->client_owner = g_strdup(dbus_message_get_sender(lr->pending)); + lr->client_owner = l_strdup(dbus_message_get_sender(lr->pending)); lr->disconnect_watch = g_dbus_add_disconnect_watch(conn, lr->client_owner, client_exited, lr, NULL); diff --git a/src/netmonagent.c b/src/netmonagent.c index 7262e0723268..2d58542d4678 100644 --- a/src/netmonagent.c +++ b/src/netmonagent.c @@ -85,8 +85,8 @@ void netmon_agent_free(struct netmon_agent *agent) if (agent->removed_cb) agent->removed_cb(agent->removed_data); - g_free(agent->path); - g_free(agent->bus); + l_free(agent->path); + l_free(agent->bus); g_free(agent); } @@ -110,8 +110,8 @@ struct netmon_agent *netmon_agent_new(const char *path, if (agent == NULL) return NULL; - agent->bus = g_strdup(sender); - agent->path = g_strdup(path); + agent->bus = l_strdup(sender); + agent->path = l_strdup(path); agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender, netmon_agent_disconnect_cb, diff --git a/src/phonebook.c b/src/phonebook.c index eb48980e7a3b..841a817b35b0 100644 --- a/src/phonebook.c +++ b/src/phonebook.c @@ -245,7 +245,7 @@ static void print_number(gpointer pointer, gpointer user_data) static void destroy_number(gpointer pointer) { struct phonebook_number *pn = pointer; - g_free(pn->number); + l_free(pn->number); g_free(pn); } @@ -268,9 +268,9 @@ static void destroy_merged_entry(gpointer pointer) { struct phonebook_person *person = pointer; l_free(person->text); - g_free(person->group); - g_free(person->email); - g_free(person->sip_uri); + l_free(person->group); + l_free(person->email); + l_free(person->sip_uri); g_slist_free_full(person->number_list, destroy_number); @@ -319,7 +319,7 @@ static gboolean need_merge(const char *text) static void merge_field_generic(char **str1, const char *str2) { if ((*str1 == NULL) && (str2 != NULL) && (strlen(str2) != 0)) - *str1 = g_strdup(str2); + *str1 = l_strdup(str2); } static void merge_field_number(GSList **l, const char *number, int type, char c) @@ -327,7 +327,7 @@ static void merge_field_number(GSList **l, const char *number, int type, char c) struct phonebook_number *pn = g_new0(struct phonebook_number, 1); enum phonebook_number_type category; - pn->number = g_strdup(number); + pn->number = l_strdup(number); pn->type = type; switch (tolower(c)) { case 'w': diff --git a/src/radio-settings.c b/src/radio-settings.c index 62ce5b6e4a9e..4cd3d6601c03 100644 --- a/src/radio-settings.c +++ b/src/radio-settings.c @@ -716,7 +716,7 @@ static void radio_settings_unregister(struct ofono_atom *atom) if (rs->settings) { storage_close(rs->imsi, SETTINGS_STORE, rs->settings, TRUE); - g_free(rs->imsi); + l_free(rs->imsi); rs->imsi = NULL; rs->settings = NULL; } @@ -805,7 +805,7 @@ static void radio_load_settings(struct ofono_radio_settings *rs, return; } - rs->imsi = g_strdup(imsi); + rs->imsi = l_strdup(imsi); error = NULL; rs->band_gsm = g_key_file_get_integer(rs->settings, SETTINGS_GROUP, diff --git a/src/sms.c b/src/sms.c index 6f9e01db5e31..2fc91f9e2162 100644 --- a/src/sms.c +++ b/src/sms.c @@ -1779,7 +1779,7 @@ static void sms_remove(struct ofono_atom *atom) storage_close(sms->imsi, SETTINGS_STORE, sms->settings, TRUE); - g_free(sms->imsi); + l_free(sms->imsi); sms->imsi = NULL; sms->settings = NULL; } @@ -1821,7 +1821,7 @@ static void sms_load_settings(struct ofono_sms *sms, const char *imsi) if (sms->settings == NULL) return; - sms->imsi = g_strdup(imsi); + sms->imsi = l_strdup(imsi); error = NULL; sms->ref = g_key_file_get_integer(sms->settings, SETTINGS_GROUP, diff --git a/src/smsagent.c b/src/smsagent.c index 08b5b34c0fd2..7e15514859da 100644 --- a/src/smsagent.c +++ b/src/smsagent.c @@ -132,9 +132,9 @@ struct sms_agent *sms_agent_new(const char *interface, if (agent == NULL) return NULL; - agent->interface = g_strdup(interface); - agent->service = g_strdup(service); - agent->path = g_strdup(path); + agent->interface = l_strdup(interface); + agent->service = l_strdup(service); + agent->path = l_strdup(path); agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, service, sms_agent_disconnect_cb, @@ -179,9 +179,9 @@ void sms_agent_free(struct sms_agent *agent) g_slist_foreach(agent->reqs, sms_agent_request_cancel, NULL); g_slist_free(agent->reqs); - g_free(agent->path); - g_free(agent->service); - g_free(agent->interface); + l_free(agent->path); + l_free(agent->service); + l_free(agent->interface); g_free(agent); } diff --git a/src/stkagent.c b/src/stkagent.c index 8748ec63022c..cd8bac6bdcd7 100644 --- a/src/stkagent.c +++ b/src/stkagent.c @@ -161,8 +161,8 @@ void stk_agent_free(struct stk_agent *agent) if (agent->removed_cb) agent->removed_cb(agent->removed_data); - g_free(agent->path); - g_free(agent->bus); + l_free(agent->path); + l_free(agent->bus); g_free(agent); } @@ -236,8 +236,8 @@ struct stk_agent *stk_agent_new(const char *path, const char *sender, if (agent == NULL) return NULL; - agent->path = g_strdup(path); - agent->bus = g_strdup(sender); + agent->path = l_strdup(path); + agent->bus = l_strdup(sender); agent->remove_on_terminate = remove_on_terminate; agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender, diff --git a/src/ussd.c b/src/ussd.c index 67a4d4eafe1f..ff372f19db1d 100644 --- a/src/ussd.c +++ b/src/ussd.c @@ -90,7 +90,7 @@ static struct ssc_entry *ssc_entry_create(const char *sc, void *cb, void *data, if (r == NULL) return r; - r->service = g_strdup(sc); + r->service = l_strdup(sc); r->cb = cb; r->user = data; r->destroy = destroy; @@ -105,7 +105,7 @@ static void ssc_entry_destroy(gpointer pointer) if (ca->destroy) ca->destroy(ca->user); - g_free(ca->service); + l_free(ca->service); g_free(ca); } @@ -232,7 +232,7 @@ static gboolean recognized_control_string(struct ofono_ussd *ussd, const char *ss_str, DBusMessage *msg) { - char *str = g_strdup(ss_str); + char *str = l_strdup(ss_str); char *sc, *sia, *sib, *sic, *sid, *dn; int type; gboolean ret = FALSE; @@ -286,7 +286,7 @@ static gboolean recognized_control_string(struct ofono_ussd *ussd, */ out: - g_free(str); + l_free(str); return ret; }