From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 64BB13983824 for ; Thu, 17 Jun 2021 18:28:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 64BB13983824 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x635.google.com with SMTP id gb32so3417727ejc.2 for ; Thu, 17 Jun 2021 11:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=wATFTGUw99oWGsfDMVnV3+ggDQOTth6Co9yaAO6KzQY=; b=Pe9ZWTQSTC4AEMPhmTyCw9um3BGRITnW9E18io/iG07i+xdBbUHFUGjBDD2CBR11uT AcPKPx0zGCzoa1Hke5yhLZdlPw7VNLJlb9hm21dZYgxweq6DmjG8U9qtwOQg0MOU43Ip Tve2GQ+qPt3qETy2/mQ1cEgOef4S8tKVIJf36/5chs8X1h4CHCcYD2H4YRAFx27vKBDl aDwb9y3Vxunk56d7Fu5hQaY6lxW/hOlWnFh80frVa9mIc6BLpAUQTpZiGCw5rUIM3zcL Wm3hXITastG+5MVREMAYJFB5JDCAA9GwBCFFkdan6d/c36xfIEhAUphGcT17Np6tuzaO HzcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=wATFTGUw99oWGsfDMVnV3+ggDQOTth6Co9yaAO6KzQY=; b=JI41ezDsN8QqZ5njO+mbcOG7OzxJYpHwNYqnjHVED+hnAF5oHCwrQReJadBXn0g3eV K+Kbirlre9ZAOXC/zMb9c47ah3Wo04pH1QScoDiBzgaihOplCKaP/ViOKQkqu4uEuy6m VfQrPDlMB42uErP0o9+8ZDVr+MzCElYqFB2rVhjwKsLLTTXIplcwF9Z1cZXb4rVPf59/ hac4zoHpCvES+io4iqv83EBWYh+PcEVFJyRbamBTpW9KYVsbZWBfud3PHUfelhBa9Il7 Fp/+chOoRGCLIrCnHbDaK0JWWhBvddFCabIKeMSt7Mohs9pSn0ptLFhMi8iRJ7Lfdq9r yO1w== X-Gm-Message-State: AOAM531eVnooX9gWy2OuDKmpcLdqpRPIGQH5x3At6UKRoBrA6zmgbKOX n31oL+kVtqfyrh4v3d91xQhGf+RaQXCau5KxkqaCGFgZbA== X-Google-Smtp-Source: ABdhPJxuRYnOkC4fy3GZYu9Gzc7mejBds+oYFerkm6geGB9UuvE2AFRras+6Whs0hibc6Ruo/D2xMNjy3Q3RN2nqHp0= X-Received: by 2002:a17:906:6899:: with SMTP id n25mr6765917ejr.462.1623954531391; Thu, 17 Jun 2021 11:28:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: C Howland Date: Thu, 17 Jun 2021 14:28:40 -0400 Message-ID: Subject: Re: Fw: makedoc.c: Coverity Scan Issues To: newlib@sourceware.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 18:28:53 -0000 > > ------------------------------ > *From:* Newlib on > behalf of Joel Sherrill > *Sent:* Thursday, June 17, 2021 2:06 PM > *To:* Newlib > *Subject:* makedoc.c: Coverity Scan Issues > > > Hi > > Scan reports 3 issues in makedoc.c. > > One is a memory leak around lines 1202 to 1282 because the variable word > holds memory allocated inside nextword. The method returns without freeing > the memory. I think adding a free() is sufficient for this. > > The others are from calling realloc() and not checking for NULL around line > 137. Is checking for the NULL, printing a message, and exit(1), an OK thing > to do here? > > Yes, that sounds good. (Seems very unlikely it would ever happen, anyway.) Craig > Thanks. > > --joel > > >