From b63646d69c3d0c98226468ff184d100b94d01820 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Mon, 19 Nov 2018 08:35:31 +0900 Subject: [PATCH] bin/trash: Fix PVS 787 Fix 'err' is assigned values twice successively. Change-Id: I783094dacbd99880381d0359c66359177611506e Reviewed-on: https://review.haiku-os.org/746 Reviewed-by: Adrien Destugues --- src/bin/trash.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/trash.cpp b/src/bin/trash.cpp index 610eb72955..5cde95ce41 100644 --- a/src/bin/trash.cpp +++ b/src/bin/trash.cpp @@ -76,6 +76,8 @@ status_t trash(const char *f) return EALREADY; entry_ref er; err = get_ref_for_path(f, &er); + if (err < 0) + return err; BPath orgPath(&er); err = orgPath.InitCheck(); if (err < 0)