Spotted by Coverity Scan Signed-off-by: Fabio M. Di Nitto <fdini...@redhat.com> --- :100644 100644 577c74a... 703fa17... M config/libs/libccsconfdb/fullxpath.c config/libs/libccsconfdb/fullxpath.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/config/libs/libccsconfdb/fullxpath.c b/config/libs/libccsconfdb/fullxpath.c index 577c74a..703fa17 100644 --- a/config/libs/libccsconfdb/fullxpath.c +++ b/config/libs/libccsconfdb/fullxpath.c @@ -326,6 +326,11 @@ char *_ccs_get_fullxpath(confdb_handle_t handle, hdb_handle_t connection_handle, } } + if (list) + if (set_previous_query(handle, connection_handle, + (char *)query, OBJECT_PARENT_HANDLE)) + goto fail; + rtn = malloc(size); if (!rtn) { @@ -342,10 +347,6 @@ char *_ccs_get_fullxpath(confdb_handle_t handle, hdb_handle_t connection_handle, node->children ? node->children-> content : node->name); - if (list) - set_previous_query(handle, connection_handle, - (char *)query, OBJECT_PARENT_HANDLE); - } else errno = EINVAL; -- 1.7.4.4