Skip to content

Commit

Permalink
CONFDB: move sanity check
Browse files Browse the repository at this point in the history
closer to a place where argument is really used

Reviewed-by: Alejandro López <[email protected]>
Reviewed-by: Pavel Březina <[email protected]>
  • Loading branch information
alexey-tikhonov committed Sep 5, 2024
1 parent 50b4579 commit 604be8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/confdb/confdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,11 @@ int confdb_init(TALLOC_CTX *mem_ctx,
int ret = EOK;
mode_t old_umask;

if (cdb_ctx == NULL) {
DEBUG(SSSDBG_FATAL_FAILURE, "Bad argument\n");
return EFAULT;
}

cdb = talloc_zero(mem_ctx, struct confdb_ctx);
if (!cdb)
return ENOMEM;
Expand Down
5 changes: 0 additions & 5 deletions src/tools/common/sss_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ errno_t sss_tool_confdb_init(TALLOC_CTX *mem_ctx, struct confdb_ctx **_confdb)
errno_t ret;
struct stat statbuf;

if (_confdb == NULL) {
DEBUG(SSSDBG_FATAL_FAILURE, "Bad argument\n");
return EFAULT;
}

ret = stat(path, &statbuf);
if (ret != 0) {
ret = errno;
Expand Down

0 comments on commit 604be8d

Please sign in to comment.