diff options
author | Karel Zak | 2019-05-15 16:09:16 +0200 |
---|---|---|
committer | Karel Zak | 2019-05-15 16:09:16 +0200 |
commit | 6d92f7d7bf3da6b3230a1a252df55f962b5f1361 (patch) | |
tree | 94a9af9a8a7302ec7e7b44f1860ddbb6aa1a5292 /lib | |
parent | lib/path: fix resource leak [coverity scan] (diff) | |
download | kernel-qcow2-util-linux-6d92f7d7bf3da6b3230a1a252df55f962b5f1361.tar.gz kernel-qcow2-util-linux-6d92f7d7bf3da6b3230a1a252df55f962b5f1361.tar.xz kernel-qcow2-util-linux-6d92f7d7bf3da6b3230a1a252df55f962b5f1361.zip |
lib/strutils: keep static analyzer happy [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/strutils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/strutils.c b/lib/strutils.c index 8076574c5..e170f560f 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -869,8 +869,10 @@ int streq_paths(const char *a, const char *b) ((a_seg && *a_seg == '/') || (b_seg && *b_seg == '/'))) return 1; + if (!a_seg || !b_seg) + break; if (a_sz != b_sz || strncmp(a_seg, b_seg, a_sz) != 0) - return 0; + break; a = a_seg + a_sz; b = b_seg + b_sz; |