From fe45bca164deeb1be053f5755546d71cc5dfd89b Mon Sep 17 00:00:00 2001 From: caodongxia <315816521@qq.com> Date: Mon, 9 Aug 2021 14:27:22 +0800 Subject: [PATCH] fix-return-val-process --- clamonacc/client/client.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clamonacc/client/client.c b/clamonacc/client/client.c index 347070f..71c153d 100644 --- a/clamonacc/client/client.c +++ b/clamonacc/client/client.c @@ -207,12 +207,12 @@ int16_t onas_ping_clamd(struct onas_context **ctx) if (opt) { attempt_str = cli_strdup(opt->strarg); + if (NULL == attempt_str) { + logg("!could not allocate memory for string\n"); + ret = -1; + goto done; + } if (attempt_str) { - if (NULL == attempt_str) { - logg("!could not allocate memory for string\n"); - ret = -1; - goto done; - } interval_str = strchr(attempt_str, ':'); if ((NULL != interval_str) && (interval_str[0] != '\0')) { interval_str[0] = '\0'; -- 2.27.0