From 4aee257140e7ae02fc02333ccb658e77aff42c01 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 25 May 2011 19:59:38 +0000 Subject: [PATCH] Fix crash if /var/lib/scst/pr not found git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3478 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_pres.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index f7846f714..0ca4c92ba 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -1182,7 +1182,8 @@ static int scst_pr_check_pr_path(void) scst_pr_path_put(&nd); #else res = kern_path(SCST_PR_DIR, 0, &path); - path_put(&path); + if (res == 0) + path_put(&path); #endif if (res != 0) { PRINT_ERROR("Unable to find %s (err %d), you should create "