Skip to content

Commit

Permalink
tconfig: review fixes
Browse files Browse the repository at this point in the history
- Check return value of toml_table_in, toml_array_in
  • Loading branch information
metalefty committed Aug 25, 2024
1 parent 12287b9 commit dbfbf5e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions xrdp/xrdp_tconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,11 @@ static int tconfig_load_gfx_order(toml_table_t *tfile, struct xrdp_tconfig_gfx *
config->codec.h264_idx = -1;
config->codec.rfx_idx = -1;

toml_table_t *codec = toml_table_in(tfile, "codec");
toml_array_t *order = toml_array_in(codec, "order");
toml_table_t *codec;
toml_array_t *order;

if (codec && order)
if ((codec = toml_table_in(tfile, "codec")) &&
(order = toml_array_in(codec, "order")))
{
for (int i = 0; ; i++)
{
Expand Down

0 comments on commit dbfbf5e

Please sign in to comment.