From patchwork Tue Jul 9 11:08:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Glembotzki X-Patchwork-Id: 1958324 Return-Path: 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=Frk0Nu01; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=m0q6KOHQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::237; helo=mail-lj1-x237.google.com; envelope-from=swupdate+bncbdy5juxlviebbr5xws2amgqez3ax7ma@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lj1-x237.google.com (mail-lj1-x237.google.com [IPv6:2a00:1450:4864:20::237]) (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 4WJJLg45ztz1yV0 for ; Tue, 9 Jul 2024 21:15:23 +1000 (AEST) Received: by mail-lj1-x237.google.com with SMTP id 38308e7fff4ca-2ee9d3b64a8sf5169331fa.1 for ; Tue, 09 Jul 2024 04:15:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720523721; cv=pass; d=google.com; s=arc-20160816; b=urPe63B8LZY11+LtCNSoQWphsWdzyzUobqxs04EeL+DPJAlUL6/1JA4HjBFGQQusoY tiRDi4jp13QTqKrMGnXudgG8ak62nHPtVUPYOAyko0j7wsGU6zG9D3w9QGnu9Mkqw4Sb SD0EWI80jZn2wNaUf+R72KdKFotYjWHv6vloAA705A1y0LO2AWUFIDZvxb7iKys09gic dbube4C1HWRxVKv+axVowki/INgu1wRibL7WhvmqjXfIHuH9y69vho0k8l/lRFtJnfBM fRGbl8f7Bfat+/kjgfSgwGvxhO1kIhhjjcowk2MFh7Iex/O7lBYxXW7IWYzodn8dFNYq s8Vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=x3Sm00r+kc+sDMGeVLfOXO1oB4dED7HsPcQngtRCvT4=; fh=0XqgmPI9G9socKy4joUdt1xPhfHCfZk4Cx2AYs+zgeQ=; b=kRRpREwmCrK41znE+okQXwJ/0suSv+hgUZaD0pEPrm4ZbENX0YPF1mN4NQkHfRVkDo cHIyel4oKKyLYND9NamH+FaXYM6o8pO3YbaehOjQ4zpK2hI8kmrdR/xhFxnA0Uyb8YPR S72VJbuv0plwu5LZRfF1KtYWGx8UpZrcAgFKsLx8yMB5HkFeSPAzSGjxH+IOALYxqCSa tXGOrKj7VpcnJvdkwUGKG/SWORwJOizt72AfjB792+rilqDci9ZbpCAvBio7EnCex78M eyfGx7yy3Vpm6Oj1PsYRLpoIZynNQEl6H8hf0xRqdzzVQKnh0lXwb41Uda1fxYqpxQD3 uTHA==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OY5kA+cK; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::631 as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1720523721; x=1721128521; 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:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=x3Sm00r+kc+sDMGeVLfOXO1oB4dED7HsPcQngtRCvT4=; b=Frk0Nu01DgFXX6G6hSTNF0edvxhOB+/8M39E8TPi/UidvXVUnr2ep4T3EIFOPh5h9R gmggakvA8VCSRsu/fFmuOc+jpt98MGF8nQQijhI9PYg2c6Wd4968mgMzVLB6PgYlHlQs 6ZV8CBJzacqp6mMXIShpUTiGhA0/fW3yVGJuFd9n3mWiFkunN+89KbwYrG0tVmSweJbb ai3f6MGLMdDYJ5dQWyxCqmip+2tAsjWv3xXkaPz5Hmgzh1XYpZnaZSZXJ7E3OYtuvhjJ 2qmSl/KXxqVIooLkMyvfPmJiwv1ZQplwBMNtbb0sez+kfBReu4cYu64MwIjyH5wQU9zH CabQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720523721; x=1721128521; 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:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=x3Sm00r+kc+sDMGeVLfOXO1oB4dED7HsPcQngtRCvT4=; b=m0q6KOHQwzKpRMTXMyxeHHZv9tuYYt0opmLRouvgkPTH0wuQTqMzuyhImlvi+wX1es iUvVW8Ze0+6LdTJkd3fFjhGdWtvZdFUVwSDbyXPsu8JE63OPmfEa9igUHXS6VXgvSFE4 vV1Yt78AvzOmvh5iXi/5Lu3Ejz3f51m+GQT+43wKzUWv6b6mcdu7OdGRLfmeyVUs9xJ2 GWvYgq7mhCV+bNz6ZbgPn6A+RgLdx7jAtB8y8YYi4LwnKglQvANqck59wQB9O0MvnS8n KwoxMCXRmjN/9b+WhG8FsdTpXUj4b/ak7d8gpf9HB+q+0bjrlqrJseQ9n2MDQ/XESsEd 8x/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720523721; x=1721128521; 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 :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=x3Sm00r+kc+sDMGeVLfOXO1oB4dED7HsPcQngtRCvT4=; b=JL8Y+r+GVWcn++5wIFZ+OtpsYWbjbwh8TCH/Q87FWVFLCS+r3wUJ3YuP+tIy9+qOVM txwJpkUGsZpHUklWkaJv47zT+Nbz75YmmPXgm2SaALOHyRugcfX6ZNEq2ZXKChE0e9/m j9HpElq7B/XU8PsZLBsjG2ZLsofZW6rTDCrZogaGyofzIJamPLcS9n6lFHfbP2OmZZFA jwFPzUwxWVWrxRnAz1PB3Lie8iO6w6yt5kvS7bXQ0JHIYbRAca1bOZ+Ogjkx/vYExgMR MHRC3+/YxkZaMo2uflb9qNhfNvBf0BAXOgDChScRBD9b87f2hW+BwQfbr37hIEVLlMjp rcig== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXvbVl2f7qxL3aU5DLfQpuWV46QX2BZApB0XR4AKlghpFpfhnDImnEy2ZdObtLv2XvM1sXwVsoWfUN+WyfhcgG8S7qoTHD1Jd61V2/yMA== X-Gm-Message-State: AOJu0Yz8pitzPdPPluWPxTFPWnRe1tReWZVhm9igIFngYggr7JeFwb/M zKXYB8KjpAsar/nMWkz4xLTfHbQN4Rt/n93+9/81TcJt5bsM7ucj X-Google-Smtp-Source: AGHT+IHMK33cCpuzlTaS3xwlmsBFC/VY51N2CCvACgwvfngyCJbgNxvOf9qDrIVXbFdMFJm184HPgw== X-Received: by 2002:a05:6512:1304:b0:52e:7bb4:942d with SMTP id 2adb3069b0e04-52eb998fccamr1339639e87.1.1720523720237; Tue, 09 Jul 2024 04:15:20 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ac2:5f62:0:b0:52c:e511:acdf with SMTP id 2adb3069b0e04-52e9f169435ls2460608e87.0.-pod-prod-08-eu; Tue, 09 Jul 2024 04:15:17 -0700 (PDT) X-Received: by 2002:ac2:4281:0:b0:52e:9471:e533 with SMTP id 2adb3069b0e04-52eb99d5fb9mr1317563e87.66.1720523717264; Tue, 09 Jul 2024 04:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720523717; cv=none; d=google.com; s=arc-20160816; b=KYVfRsNqbYypwbaVY4/MIhNxW6AC7ZPCtIYBOiUkhdKQiIOKvqmpfXQ6PKVCfEKkd6 W2pWp0QcSGpQOG/VAGA68TA4M8hmt87Nex9+icLy5QqLcOQo/fcZHGMHbMol8GkktkOO a8W5TdskEYXGgxp4mhqtr+Z7/p/jCa8BLJzAcmGJKNqrIq60Udqc4yUnYTEsBRxjdabt ynG7OSuxSZF9g7O5KtgcOyiz1QuxObQyEq3tzUcstwuF4Q8P0xti0Jr4b8rnQ6QTpbWM SrcDzWX1P4qoQSaaMJ1YW1jjmnm42LJMj4WZA+enfGXv7uG12sOdpD7qbJZ40Ux/H8Ok wt/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=kCI+fyL64e7eZoDJwLBDGJN/CsLkEmd8y9siW0RWjBg=; fh=zydHuzCQWrku2OPQyZfraJZFcOpEXLQ/YBcu3QNiBd0=; b=wt+b/Tp1B0YOV23tJVEiJcJFxjo080dIQGa7EnEnMp11IFOpPJdwxZ+icGgztSZIR5 WVsNKlib6psKhcP4cwjQBTjGGngytwcSj+MJIEWMKj4aWGwjWMpxxV8hn89sCUQZ61Ad QNbjusEsuqh3SMRHxcrKXwTNAxA8Ye4wINMtJhZg4kMKoAngn+CB3J9nK3TMgDcttQZF MwIVKivoefb1cg1vzEktMUnzLi2XtVY+9cWnOqKVDJqpckB4CUAxAQg5zKSorUCf/f6W 762Png3s+elMQc3VsSCeTpi53GLbwXGR0xXKkh7hlU9bluSHZTiafqp9x06Bez2JkVjI QT4Q==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OY5kA+cK; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::631 as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com. [2a00:1450:4864:20::631]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-52eb8e411d4si31713e87.4.2024.07.09.04.15.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jul 2024 04:15:17 -0700 (PDT) Received-SPF: pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::631 as permitted sender) client-ip=2a00:1450:4864:20::631; Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a77dc08db60so429373266b.1 for ; Tue, 09 Jul 2024 04:15:17 -0700 (PDT) X-Received: by 2002:a17:907:d93:b0:a75:20f7:2c71 with SMTP id a640c23a62f3a-a780b6ff667mr235221266b.38.1720523715986; Tue, 09 Jul 2024 04:15:15 -0700 (PDT) Received: from PC-2635.irisgmbh.local (dslb-002-203-138-100.002.203.pools.vodafone-ip.de. [2.203.138.100]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a6bc8adsm70739166b.14.2024.07.09.04.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 04:15:15 -0700 (PDT) From: Michael Glembotzki To: swupdate@googlegroups.com Cc: Michael Glembotzki Subject: [swupdate] [V3][PATCH 06/21] mongoose: Remove double free calls Date: Tue, 9 Jul 2024 13:08:42 +0200 Message-ID: <20240709111440.8215-7-Michael.Glembotzki@iris-sensing.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240709111440.8215-1-Michael.Glembotzki@iris-sensing.com> References: <20240709111440.8215-1-Michael.Glembotzki@iris-sensing.com> MIME-Version: 1.0 X-Original-Sender: m.glembo@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OY5kA+cK; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::631 as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , mp_streami->part.name and mp_stream->part.filename are already freed in mg_http_free_proto_data_mp_stream(). Signed-off-by: Michael Glembotzki --- mongoose/mongoose_multipart.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mongoose/mongoose_multipart.c b/mongoose/mongoose_multipart.c index fb62c1e4..3361169c 100644 --- a/mongoose/mongoose_multipart.c +++ b/mongoose/mongoose_multipart.c @@ -142,10 +142,6 @@ static void mg_http_multipart_finalize(struct mg_connection *c) { struct mg_http_multipart_stream *mp_stream = c->pfn_data; mg_http_multipart_call_handler(c, MG_EV_HTTP_PART_END, NULL, 0); - free((void *) mp_stream->part.filename.ptr); - mp_stream->part.filename.ptr = NULL; - free((void *) mp_stream->part.name.ptr); - mp_stream->part.name.ptr = NULL; mg_http_free_proto_data_mp_stream(mp_stream); mp_stream->state = MPS_FINISHED; free(mp_stream);