fix potential deref of a null pointer

This commit is contained in:
0tkl
2023-08-02 14:12:03 +08:00
parent 4ca66cc7fe
commit 434cd68a23
4 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -7,7 +7,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 04/01/2019
Last Updated: 08/02/2023
******************************************************************************
*/
@@ -41,6 +41,7 @@ file_handle_t *create_file_manager() {
file_handle_t *file_handle;
file_handle = (file_handle_t *)calloc(1, sizeof(file_handle_t));
if (file_handle == NULL) return NULL;
file_handle->filename = NULL;
file_handle->file = NULL;