Message ID | 20241003143736.1160396-1-toertel@gmail.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCEMDFWL6ALRBXGY7K3QMGQEGSG6DGI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=QY/NypfN; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BdJeeU2U; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::137; helo=mail-lf1-x137.google.com; envelope-from=swupdate+bncbcemdfwl6alrbxgy7k3qmgqegsg6dgi@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lf1-x137.google.com (mail-lf1-x137.google.com [IPv6:2a00:1450:4864:20::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XKDnL0mMjz1xt1 for <incoming@patchwork.ozlabs.org>; Fri, 4 Oct 2024 00:38:28 +1000 (AEST) Received: by mail-lf1-x137.google.com with SMTP id 2adb3069b0e04-53991bb134bsf677897e87.0 for <incoming@patchwork.ozlabs.org>; Thu, 03 Oct 2024 07:38:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727966303; cv=pass; d=google.com; s=arc-20240605; b=c7WWGI812IJ7pUKXm+ADrznQ5alxij2/oXIwh5ooDHHMXDD7gCFh6ShtBGFaDjyiaH Tl1EMvLpHapPy6aFQDHPkc9uj9AAE3PnDHiUmqr899RRcINfLu7zZpj+Gkz0SmAxpAcK beXqN+6NtKFG2tp0xM2avkCP5rQVLxkcM9rCizpMe5qEXXdpCnPBpcP7LjJ7+jajwJ1T +fLqsl5U0//JGlxbiy44Uokkp4pIVzSyIFgmY13bM4tKlZdoa+u67tyVIDKMQxdYuv/5 Gla+8E7rqOXcdWY6fPl84zxoTZxQfsEt360sGoCHoVCn9CdOoNwwbGqCTKLc74/rk7+i qtaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature:dkim-signature; bh=SQnO6d9iQaXe/QrIu9MDCFx19iKNBNouwuqI+XqvFuk=; fh=20Xmzc+G/agSYfSnzzqJfY/cn0eFfLnSef70+vw7ysg=; b=hPOcgTnXUyyktz4+RqGkSOV0kFHoYE0D7dQ9Lo30i+diTlxkp829+uPB1gZzNqpdUY FeAxI1DmIzqyLTSStRaNgj2hNdvEZug9ASSrn8oSkCRdW6PyfhTPcqlOQr0mI7huRM5q CFjDmwmVoes57BpGnsOxLKbmA5fdScEMGXvTHFYfOLwvWJujNuApAwk2DmhXSx3tWI1+ qdu5I2/mW4WViuccf3WBAj+AJ1Cc0X8nFsHhYEukShSQE1nS1oCfpsDScQx+3FtZHBOJ IXj/LOw4+j0Xj4oPytKLIUQdZOsEpbbY29jhqM5V6gFZBfvDXPIK0P37wdaxa8Xxu1gM D+UQ==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L1Cp7Uwz; spf=pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::52c as permitted sender) smtp.mailfrom=toertel@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=pass header.i=@googlegroups.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1727966303; x=1728571103; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=SQnO6d9iQaXe/QrIu9MDCFx19iKNBNouwuqI+XqvFuk=; b=QY/NypfN8w3Ow5Kri6MImmc46VgspRymtIKzO/CnNAfnEWJKN66k4l1pLP7tlTow4p UGiudEnmfb/52Xg7t0Q1wumpb4q/v/+jrbmnRhNhLll56o13YpsabSORod3cjCuWcXSJ MWnkdvrDoEFS+t0boC23SoU38ZEh6egDL3OwAgL5xpTtJzw5eagPvQd+LWeirl9MGHez N1dCxUnVMpF1o9GmpqEGVILhnaV7bnX0q4GuTpYQog65OHVyRDgYFvf5HBwEV5jbk4nA 936sriEndmP4S8Z7qCYSfZGRv/v1camcNx6rIYM5/oE46qXStnhmLvQLIQjZJwt3E83t UZFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727966303; x=1728571103; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=SQnO6d9iQaXe/QrIu9MDCFx19iKNBNouwuqI+XqvFuk=; b=BdJeeU2U8zRVBR234cGNyqgqr5EhAG2PqwggaN1BrO+nXDbk3mU8PLLy7sqEtKEdbp x4dFlyA+1yfbBvv0UOvLPwS1yBnpNon56mMZFvLJ84E4Su+kumA3C7vGUv9MAl7fB/ms oMkxC5HGcYJIbnZxEr9akXbnPth7LcdnjO2sixiAduV8hEmlvbsRgr3/ulKuER9rlMlR WvgNCLjbyK9zgm8vg2ixxnNprpc/YVxB2CtufOKyLslCzsdgTZoZLcxX9oLAOR1TPWnf LCR7xbf0/B5J5Uzahox7Ln9bigDXZU3nyxq36xr3+B/5WejWJBhL+JZTEpec1mTXqCfQ TGTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727966303; x=1728571103; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=SQnO6d9iQaXe/QrIu9MDCFx19iKNBNouwuqI+XqvFuk=; b=gXF/rxplGCtWMf4IXuOQzWkP5zZTLzB0nd+KbmfjrsnHs69mWmXsIt0Nelw/rVwzwh QD+bMwOjw8VmGb0yRD/X4jsGftxFuvXzTdPfsxBAyy1CfvvsS6j/tVj+C401BQwffj5h Fso8FOil+izDWKwFVfxprEE7I4eag1ekfjTtxVAv818pFClRPPgWISBP2V8Ezl+i2YvU CJV8cwXaxuTIi4+p8g8RNPn++Q5X//LyMq1MC/DcS7tLa4WmvPi/3GPEqsVjhHkjd9f8 sRGpX6YbVdI1fuC/cO/iR8lGXBTqkXB/emB/Ah7bPw5wdXcBjaPbohFX1n9T5IGKPRvu s2oA== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCW8CGKzib9lEj5nTOcEcKuXHhkyK6PCj5rdgcJMenAyCYRmBdqC/EY26+NfG8bryO74yXxLMFUCpg==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0YyRGwDJiRTayBuXIVuzr7i3t1fVjKqO9K3aH7ohq8WP5nHL67/C 0g20kuQ2KZqzWdKXNmFOBfz4adyekNFbj+j2HZvRJ8xtIH8tQNuq X-Google-Smtp-Source: AGHT+IGmG2QP/nL7ecjPX0AwbnalfBDS76AAdVsC3Ucu/bHiMSdEueVMKsirKAUQ++LXP9DjcQGSNw== X-Received: by 2002:a05:6512:31c7:b0:536:7a88:616b with SMTP id 2adb3069b0e04-539a0684347mr4265592e87.26.1727966301791; Thu, 03 Oct 2024 07:38:21 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:3c99:b0:42c:b1b4:db22 with SMTP id 5b1f17b1804b1-42f7dfc2461ls4843995e9.2.-pod-prod-02-eu; Thu, 03 Oct 2024 07:38:19 -0700 (PDT) X-Received: by 2002:a05:600c:1c26:b0:42c:ba1f:543e with SMTP id 5b1f17b1804b1-42f777ee325mr56654035e9.26.1727966298807; Thu, 03 Oct 2024 07:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727966298; cv=none; d=google.com; s=arc-20240605; b=ibyK4+PUgIf6WWCT5u7xoPZs+9CT8df4cNTyvbNCHYul/Ry/NP4+hxg7CR3wifNzDq PLU8EBRGfYeWr3NGxjUP/S1RvJc6Sp1BOEajOuMuGZ68DfEuu5NwoQgR76wDOmeg+gqC zIILADc3rEtrVNBjB2wOVMrnSggzFKVV5K4kPUMEdp00jTQIqZBoRHhQGSIpxyfjYD/o SDYqzUD0Z7nXQkQafOtjxboJWGeMN2NpMuPNhYWZBpN1CwSK/wPtBMOayhbyH0Zk++LO jHPMQEX0m0fM93uKIxfIkA1DqTB9AoAtXligSgXCPQAwG0kpfmq1acKU2DBkWfRKQdBK MmNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=xiav1NVkWZNlJ3fBx/HIGIM0L9yCTPDP2vazIYGOSWY=; fh=bMd7FNCw01Atjv+nUDCz8B7Z2DBi0f8Db166U8CL41M=; b=U+B55+cbCEiwZQKQ16hn+PIjwyi8vDwPzZbFRFrdcH3XBPzmqID7wQ9VSUS/MopOgD VZQPX65xWzz6ACh8P/ZzNz8P8YWoKfUjZOQuvaJQ5qPF8VUZtO99Mp8Hagf+2KLh8dWN Dc7aFe+38ue7oI+9nbWvPcHA+xF4rmWXzD7vKIPd7KtqQ4YAsDgwDUZPVajL6SwdUWMs MiEth1f73ogI+3xxbegQ0FEj/FYGwnqrF3Kl/1Ux5P8NaDxTTKThj8KSLOIFaj05zrqR SXJ1r3zLFdG1BHwe5o+M2xvxjdr6eiYuEW0DWdEIc7QryFm/8dFVGWuwMqOnxW+uabHA II/w==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L1Cp7Uwz; spf=pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::52c as permitted sender) smtp.mailfrom=toertel@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=pass header.i=@googlegroups.com Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com. [2a00:1450:4864:20::52c]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-42f8019520asi276735e9.0.2024.10.03.07.38.18 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Oct 2024 07:38:18 -0700 (PDT) Received-SPF: pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::52c as permitted sender) client-ip=2a00:1450:4864:20::52c; Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5c8952f7f95so1106789a12.0 for <swupdate@googlegroups.com>; Thu, 03 Oct 2024 07:38:18 -0700 (PDT) X-Received: by 2002:a05:6402:3907:b0:5c8:9551:d597 with SMTP id 4fb4d7f45d1cf-5c8b1a32a2emr5484451a12.17.1727966298118; Thu, 03 Oct 2024 07:38:18 -0700 (PDT) Received: from ThinkCentre.fritz.box (p200300cfaf18940009a1cbc6fc862d86.dip0.t-ipconnect.de. [2003:cf:af18:9400:9a1:cbc6:fc86:2d86]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c8ca3fb296sm773762a12.45.2024.10.03.07.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:38:17 -0700 (PDT) From: toertel@gmail.com To: stefano.babic@swupdate.org, oleksandr.makhmudov@siemens.com, michael.adler@siemens.com, christian.storm@siemens.com Cc: swupdate@googlegroups.com, Mark Jonas <toertel@gmail.com>, micro6947@gmail.com Subject: [swupdate] [PATCH] Fix memory leak in parser/parser.c Date: Thu, 3 Oct 2024 16:36:00 +0200 Message-ID: <20241003143736.1160396-1-toertel@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: toertel@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L1Cp7Uwz; spf=pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::52c as permitted sender) smtp.mailfrom=toertel@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=pass header.i=@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Fix memory leak in parser/parser.c
|
expand
|
On 03.10.24 16:36, toertel@gmail.com wrote: > From: Mark Jonas <toertel@gmail.com> > > Reported-by: micro6947@gmail.com > Signed-off-by: Mark Jonas <toertel@gmail.com> > --- > parser/parser.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/parser/parser.c b/parser/parser.c > index 733df95c..f5113f94 100644 > --- a/parser/parser.c > +++ b/parser/parser.c > @@ -1159,6 +1159,7 @@ int parse_json(struct swupdate_cfg *swcfg, const char *filename, char **error) > if (!cfg) { > if (asprintf(error, "JSON File corrupted") == ENOMEM_ASPRINTF) { > ERROR("OOM when caching error"); > + free(string); > return -ENOMEM; > } > free(string); Applied to -master, thanks ! Best regards, Stefano Babic
diff --git a/parser/parser.c b/parser/parser.c index 733df95c..f5113f94 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -1159,6 +1159,7 @@ int parse_json(struct swupdate_cfg *swcfg, const char *filename, char **error) if (!cfg) { if (asprintf(error, "JSON File corrupted") == ENOMEM_ASPRINTF) { ERROR("OOM when caching error"); + free(string); return -ENOMEM; } free(string);