Bug 257317 - FTPD.c va_list opened but not closed as detected by cppcheck
Summary: FTPD.c va_list opened but not closed as detected by cppcheck
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Alan Somers
Depends on:
Reported: 2021-07-21 18:17 UTC by Alan Shearer
Modified: 2021-07-27 18:22 UTC (History)
1 user (show)

See Also:
asomers: mfc-stable13?
asomers: mfc-stable12?


Note You need to log in before you can comment on or make changes to this bug.
Description Alan Shearer 2021-07-21 18:17:47 UTC

cppcheck-2.5 detected and error in libexec/ftpd/ftpd.c.

ftpd.c:3364:1: error: va_list 'ap' was opened but not closed by va_end().

Adding 'va_end(ap);' on line 3348 should resolve this.
Comment 1 Alan Shearer 2021-07-27 16:51:20 UTC
Pull request created.
Comment 2 commit-hook freebsd_committer 2021-07-27 18:18:42 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=674400eb20b65369a88b1cb778d729bc297832c9

commit 674400eb20b65369a88b1cb778d729bc297832c9
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2021-07-27 18:14:00 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2021-07-27 18:18:08 +0000

    ftpd: delete dead code

    Delete code killed by SVN r13139 in 1996.  Little chance that it would
    still compile today.

    PR:             257317
    Reported by:    Alan Shearer <sakison@gmail.com>
    MFC after:      2 weeks
    Sponsored by:   Axcient

 libexec/ftpd/extern.h |  3 ---
 libexec/ftpd/ftpd.c   | 49 -------------------------------------------------
 2 files changed, 52 deletions(-)