mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 12:33:02 +02:00
confd: fix obvious mistakes in checking return values
Found by Coverty Scan Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -69,9 +69,13 @@ static char *iface_xpath(const char *xpath)
|
||||
{
|
||||
char *path, *ptr;
|
||||
|
||||
if (!xpath)
|
||||
return NULL;
|
||||
|
||||
path = strdup(xpath);
|
||||
if (!path)
|
||||
return NULL;
|
||||
|
||||
if (!(ptr = strstr(path, "]/"))) {
|
||||
free(path);
|
||||
return NULL;
|
||||
@@ -219,7 +223,7 @@ static int ifchange_cand_infer_type(sr_session_ctx_t *session, const char *path)
|
||||
sr_error_t err = SR_ERR_OK;
|
||||
|
||||
xpath = iface_xpath(path);
|
||||
if (!path)
|
||||
if (!xpath)
|
||||
return SR_ERR_SYS;
|
||||
|
||||
type = srx_get_str(session, "%s/type", xpath);
|
||||
|
||||
Reference in New Issue
Block a user