From 5d88111a142b3c37e92bdd36699a04fd054d27f4 Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Wed, 22 May 2019 17:46:19 +0200 Subject: Fix some "Null pointer dereference" coverity issues This patch fixes the following CID's: * 1124829 * 1274075 * 1274083 * 1274128 * 1274135 * 1274141 * 1274143 * 1274197 * 1274205 * 1274210 * 1274211 * 1288801 * 1398629 Change-Id: Ia7c86cfab3245b20777ffa296e1a59748040f558 Updates: bz#789278 Signed-off-by: Xavi Hernandez --- xlators/storage/posix/src/posix-helpers.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/storage/posix/src') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 401f8ca8578..80f5fb8514c 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -390,6 +390,9 @@ _posix_get_marker_quota_contributions(posix_xattr_filler_t *filler, char *key) int i = 0, ret = 0; tmp_key = ptr = gf_strdup(key); + if (tmp_key == NULL) { + return -1; + } for (i = 0; i < 4; i++) { token = strtok_r(tmp_key, ".", &saveptr); tmp_key = NULL; -- cgit