Skip to content

Commit d83309c

Browse files
authored
[#499Leak fix in master_key()
Signed-off-by: Shikhar Soni <shikharish05@gmail.com>
1 parent 9c44ae7 commit d83309c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/admin.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,19 @@ master_key(char* password, bool generate_pwd, int pwd_length, int32_t output_for
466466
file = NULL;
467467
}
468468

469+
pgagroal_management_create_outcome_failure(j, 1, &outcome);
470+
471+
if (output_format == MANAGEMENT_OUTPUT_FORMAT_JSON)
472+
{
473+
pgagroal_json_print(j, FORMAT_JSON);
474+
}
475+
else
476+
{
477+
pgagroal_json_print(j, FORMAT_TEXT);
478+
}
479+
480+
pgagroal_json_destroy(j);
481+
469482
return 1;
470483
}
471484

0 commit comments

Comments
 (0)