Message ID | 20240730153707.168357-19-nick.alcock@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 289D7385C6E1 for <patchwork@sourceware.org>; Tue, 30 Jul 2024 15:44:20 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 9F288385C6C0 for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:38:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F288385C6C0 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9F288385C6C0 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722353900; cv=pass; b=xJ8BU22B+UPPIwiWxsOMW/ry/BvkYBhqOec9ONIeMgJWurkSX4qL/2TxWuHtglK/MMpAlYHtxDU0FZrIBaFtDp7Udc5NWJEqixUq/qkhtim+3peE8Zr44dP/TGenCKSnq7o08GYNseMutSGJS9JKtPJx+8cweX5YFufn1KrdH+w= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722353900; c=relaxed/simple; bh=GediFsevsbB1Utv5PcJqX+7NHqRJu9TFrmggWt/cW2E=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=BqdJnTXO92FFhv6sJUZKzoOfAu/qT6JxDRYulCHlDGRmL9RAtG9ozusHChrdQ9340VX9OQwrCx41l+kf78uGfm+RXLv1L+PWN6X+eZ7HglTfhWEXBr2aGPfWQr+1Oh6nkWXzzMNeeEHY/pihtxcgLFW6fQeQee20Vel4Pd1aDfk= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46UFMWII006626 for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:38:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=WeUucV+26aPCcgUB88XwU1h2JnpU9RKQiA7t9N8jZHA=; b= hyznvApbQQjzebKRuHTt3N8FAWhALPfTTWnMhSvEcc4uiMdfj6bx6XoZqXSHlblJ sr+ol8Qr9FKR98is08q+GdImnbsOKoz0Ndd7KwbH7uja0/JELt4LNbT2ClXLWxbp 2hjsOkHKhFoCzg57t1JyyQJivdkutFnoCDtkBbhwxFX51oZkLPihGDgk8F07OMfF 4uHNphjtBVyU8HbZdrw1Z0qwu21j7ZLLCD2wpM1IRrBIS7dFO2iIWLlb0YzSPdSd JMZUscUtmJEwYX3hhnWLC1z64HIqQC6wPCVoYhXXNFT8LIny2rgieco0ex3nAypt 13rZAjhNGO83GhC4nWL02w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40mrs8na1j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:38:16 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46UEYuuw035608 for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:38:15 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2043.outbound.protection.outlook.com [104.47.55.43]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40nvnwdyv7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Tue, 30 Jul 2024 15:38:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zBRixqRphtWvurRCw2JClv6SQIc9pCSMjivp9mx51L40DJyEp9EDh/+5hs3M9c5dwbzKh2dnVWO4poQE3APV1C82eSpOQgtbCBw0a1y1lBfPppyTQl/evhUlKwubtVu/5RerIgum32ZVoxM3Mc7jfUkppkbKYnS/QschciG1TO9PYtHeKFD7rnAnlZv9Y9MrAttqwdMDZPSN9TIsKO0hgiYfV1YCegWRVc3OHKMIJhwOc3qibrqQ8NXfGnGRgQ1PihmlvSnh0PrrUMnNVoOcmS7Y7fpXcLcZyIkzc5VMjK3VDD4vMbJXKfvHsgJsYpjJrU9YHpsNMsMbpXoxSC3sig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WeUucV+26aPCcgUB88XwU1h2JnpU9RKQiA7t9N8jZHA=; b=SlBiy1/ZUEoLJo7c02S6tDrH9rDSR+R0YCNIIRJM3R5FcSYCXhGILG95tMFIrbsVXZSNj5iaUOX+3tjndlDAE9tBzgk2394tvqqvs0UwUBHT9TILr6WWo71+XP6xVTJeniCMk8XtVV1Sud9NNsLDXHIZxrnHi4lJZRpfkk+FSeqptoHiXUKQMRBO1CctqepJr4+UbYwGXY/d4U8Oaufnx4pLsVJBdn7jkaBd/9ulzdXH3j68jfB7Y5CxEVXTns4R2SLctCpaFjxR6Xt9jaqBzoneoxRv9e4s0E9CDwlDXSjZ+tCj2xRHedNpddQLVKfYDce9wXE05FKMBbZkqxFRXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WeUucV+26aPCcgUB88XwU1h2JnpU9RKQiA7t9N8jZHA=; b=JoYZJadc/QLkzQQjEhRfNLbBOc13Cek8S22h84FRVZBwMYu6OGUwA8CzhmSMuD0NIibA8yHXeKf+NFXz0U4+dyal68s2zR7G8Af0WTunblO2rf9mE3XZg4w66Ps2AhkpDYPZYf7A1E+wsCwPATOAmfCYSMPpAVP/0lASQep9NtQ= Received: from MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) by DM4PR10MB7476.namprd10.prod.outlook.com (2603:10b6:8:17d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 15:38:13 +0000 Received: from MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::b53a:ccc1:c190:c5df]) by MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::b53a:ccc1:c190:c5df%6]) with mapi id 15.20.7807.026; Tue, 30 Jul 2024 15:38:13 +0000 From: Nick Alcock <nick.alcock@oracle.com> To: binutils@sourceware.org Subject: [PATCH 18/19] libctf: dump: fix small leak Date: Tue, 30 Jul 2024 16:37:06 +0100 Message-ID: <20240730153707.168357-19-nick.alcock@oracle.com> X-Mailer: git-send-email 2.45.2.276.g4ac82df17e In-Reply-To: <20240730153707.168357-1-nick.alcock@oracle.com> References: <20240730153707.168357-1-nick.alcock@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: LO4P123CA0505.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:272::15) To MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR10MB6608:EE_|DM4PR10MB7476:EE_ X-MS-Office365-Filtering-Correlation-Id: 423fd2bd-30bd-43f1-c0e2-08dcb0ad9fb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: 6GNfCxOB1VDG9NyVacfAJivCisaZagSC8e1V0pKfu2NRowmj72tg3pguS8Myl0vxEfLb06sY95GVqL1OLR9tSHfFbrSyxDNoGVvoI2mTp4Tt4tYoY2cFtsMIi98x66Z2jSgigQrxpzkF1Jta51vQfYSvlFEJVO2XZwmbyzL3B5L4t6HT/gKZ+WdGhiIyAJpl/0Nmks1c5I//7Jm7qYcch1Zhju8SQYBWO/wah5KYvyOW9K8YdcsK37lM0rBNBPLf5DAAw6AftdH10BrAHIFEEHzQcMAlk0yP5qpDxNJj2FrWaSo83ilQ3tSrSvpG9Obnq28E4qXZgFeHAFwMN90MnZXKfjDHDE2RIzZpl4sG93NvGoX2LD3C3S8GJZ2A3BNVBFYrzO3psmTLvwZ4NbbVcf7sq7KT9BDt39LC9wJog81uhmYDx+cqguRU0cNVLKCQAA0yruR0MhJf8maKsdFzF6kq3vgVjimqhrTw7ooycOW4CmsFTRAS73p2ktPoF+cvDjeGdH/gPMzgG66GwSmNNDwLewbOKbHYhqSG4HJn0kCXL693TIr766wES9mVdNtYHVJq76mmvAmRTdkoM1Wcbd9Fd6aWPixG7OkFMjzM8oIETawG3fmNnAv+6xll6UfttivTMryXLNfNB0LYWLtVhFcbgl8/EsRo6OBAimceyUIsnfGP81L7dDNPuHI0KEt9zgk2DwPo/7MNweed6yOI7sN0torfZnQ9/DPQdOoLidUvWfTW4XGFmgfehsGwQEgZQFmotn4yefD4ngvtyhJYF0yeBPQEzif2x90o/FWu4VygLbNsCbWx64KRSfrCAU8h1/PadOptdDVU80tcTwxPcz2/gNE0PfoEvHuJAWt4cNTF1AJ6CZal6Vpk10Q+4wQOlNNNn09fswh856RFrMRFGrPCokv/7CaPsNwVVPK/4xCRqOmkMk5p1F8svXAidGsGe9SVQAr/FXMKOwdV3okgJaoA58bzdi6BfA0ssbFakMv6VhEM+rKVugjNT8oU0QvuGQryw9/7ChzLGbIHi2zh3AIrClghKMvB4S4K+MZ14CJ/nEddgbwPW2y99fEETJZDvkAyaTRWP6gYeUNRsp4KsisiMEqg/rN6AiDo8HvcV/fC5ljNGrTLW1yRmi6Nazvvcxdh1xghXvyMt7dGgru7i/FR1Hf33bFG5rbmmZhaH7Gv5xFJQWil2m+fmgnK1HURBby7/dl9YPUm+zIuaGZATK9e5u4o7dl4aFGSCtpMNGvl24842CofMxAwq8QzH11AyI79uSuJzjMN+mm43r6bPWIdMjvkx6Kw8rxHNVFL4Zxvbl9ZHargkIdjYKbW9Pgw//y1akDfa+61DBUHww/J8w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR10MB6608.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4wMqyoVJ+bSyOlIyaySPRG+UTzPkaylNh9a6lo9fwV0YUfkYULm4oTQxUraf7bsKy++b4wpyNeHjOySeu0zKQGe9/y9fReJrhGH5ZbkMc0Ni8wsXZi5br/AhK2PzvoRNsvDlze7cw5NIvqV0cmcq77rJr49hc1W6ubLoutIMYVimRfTfOO5oEYjXx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MS-Exchange-CrossTenant-Network-Message-Id: 423fd2bd-30bd-43f1-c0e2-08dcb0ad9fb1 X-MS-Exchange-CrossTenant-AuthSource: MW4PR10MB6608.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 15:38:13.5892 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q6v2WzHB1LSftIgKe5jlYYJJyCwYmlo7e2KGxSmFfjp66iVoQsHrt5Qp/SWCP8C0y6V7+mov+/hyxByt5EDbBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB7476 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-30_12,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=616 mlxscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407300106 X-Proofpoint-GUID: w9Zlw64h9Ue4Q7kiPTrMi4uOwdZzudot X-Proofpoint-ORIG-GUID: w9Zlw64h9Ue4Q7kiPTrMi4uOwdZzudot X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
Series |
libctf: various bugfixes (including a write into freed memory), and loosen constraints on enums
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_binutils_build--master-arm | success | Build passed |
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | success | Build passed |
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 | success | Test passed |
linaro-tcwg-bot/tcwg_binutils_check--master-arm | success | Test passed |
Commit Message
Nick Alcock
July 30, 2024, 3:37 p.m. UTC
If you asprintf something and then use it only as input to another asprintf, it helps to free it afterwards. libctf/ * ctf-dump.c (ctf_dump_header): Free the flagstr after use. (ctf_dump): Make a NULL return slightly clearer. --- libctf/ctf-dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libctf/ctf-dump.c b/libctf/ctf-dump.c index cd41996084d..a37d4b75d45 100644 --- a/libctf/ctf-dump.c +++ b/libctf/ctf-dump.c @@ -349,6 +349,7 @@ ctf_dump_header (ctf_dict_t *fp, ctf_dump_state_t *state) if (asprintf (&str, "Flags: 0x%x (%s)", fp->ctf_openflags, flagstr) < 0) goto err; + free (flagstr); ctf_dump_append (state, str); } @@ -814,7 +815,7 @@ ctf_dump (ctf_dict_t *fp, ctf_dump_state_t **statep, ctf_sect_names_t sect, if (!str) { ctf_set_errno (fp, ENOMEM); - return str; + return NULL; } }