From: Eric Biggers Date: Fri, 26 Jul 2019 05:11:33 +0000 (-0700) Subject: update_image.c: check malloc return value X-Git-Tag: v1.13.2~6 X-Git-Url: https://wimlib.net/git/?a=commitdiff_plain;h=08df9572bf0eba21ac92e9715558c28b1f08fe09;p=wimlib update_image.c: check malloc return value --- diff --git a/src/update_image.c b/src/update_image.c index 2247a7f6..f4affbdd 100644 --- a/src/update_image.c +++ b/src/update_image.c @@ -742,9 +742,12 @@ get_capture_config(const tchar *config_file, struct capture_config *config, size_t len = tstrlen(fs_source_path) + tstrlen(wimboot_cfgfile); - tmp_config_file = MALLOC((len + 1) * sizeof(tchar)); struct stat st; + tmp_config_file = MALLOC((len + 1) * sizeof(tchar)); + if (!tmp_config_file) + return WIMLIB_ERR_NOMEM; + tsprintf(tmp_config_file, T("%"TS"%"TS), fs_source_path, wimboot_cfgfile); if (!tstat(tmp_config_file, &st)) {