Skip to content

Commit c3ca3e9

Browse files
committed
server config REFACTOR param order
1 parent 572d92e commit c3ca3e9

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/server_config_util_ssh.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,8 @@ _nc_server_config_add_ssh_user_password(const struct ly_ctx *ctx, const char *tr
502502

503503
NC_CHECK_ARG_RET(NULL, ctx, tree_path, password, config, 1);
504504

505-
cdata = (struct crypt_data *) calloc(sizeof(struct crypt_data), 1);
506-
if (cdata == NULL) {
507-
ERR(NULL, "Allocation of crypt_data struct failed.");
508-
ret = 1;
509-
goto cleanup;
510-
}
505+
cdata = calloc(1, sizeof(struct crypt_data));
506+
NC_CHECK_ERRMEM_GOTO(!cdata, ret = 1, cleanup);
511507

512508
hashed_pw = crypt_r(password, salt, cdata);
513509
if (!hashed_pw) {

0 commit comments

Comments
 (0)