Skip to content

Commit 9396b57

Browse files
gaoyusongsimo5
authored andcommitted
gssproxy: check result of calloc() is necessary
Signed-off-by: gaoyusong <gaoyusong2@huawei.com>
1 parent 159794c commit 9396b57

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gssproxy.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ int main(int argc, const char *argv[])
114114
}
115115

116116
gpctx = calloc(1, sizeof(struct gssproxy_ctx));
117+
if (!gpctx) {
118+
ret = EXIT_FAILURE;
119+
goto cleanup;
120+
}
121+
117122
gpctx->config_file = opt_config_file;
118123
gpctx->config_dir = opt_config_dir;
119124
gpctx->config_socket = opt_config_socket;

0 commit comments

Comments
 (0)