From d2bc216886b9d9524ecf5bfa68c6c01b3df24548 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 18 May 2015 13:43:30 -0400 Subject: [PATCH] eina-bt: Fix Coverity CID1297405 (dereference before null check) @fix Signed-off-by: Chris Michael --- src/bin/eina/eina_btlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/eina/eina_btlog.c b/src/bin/eina/eina_btlog.c index 3dbd40cbc6..67b63e6b3e 100644 --- a/src/bin/eina/eina_btlog.c +++ b/src/bin/eina/eina_btlog.c @@ -50,7 +50,7 @@ struct _Bt static void path_split(const char *path, char **dir, char **file) { - const char *p = strrchr(path, '/'); + const char *p; if (!path) { @@ -58,6 +58,7 @@ path_split(const char *path, char **dir, char **file) *file = NULL; return; } + p = strrchr(path, '/'); if (!p) { *dir = NULL;