]> wimlib.net Git - wimlib/blobdiff - src/update_image.c
Consistently use _WIN32 instead of __WIN32__
[wimlib] / src / update_image.c
index b6fb67c095d23c670a8a3b590ac27e1b1c2b8716..2964b71778f49099da55ceaa991be2fdf6161d5f 100644 (file)
@@ -716,6 +716,8 @@ static const char wincfg[] =
 "/swapfile.sys\n"
 "/System Volume Information\n"
 "/RECYCLER\n"
+"/$RECYCLE.BIN\n"
+"/$Recycle.Bin\n"
 "/Windows/CSC\n";
 
 static const tchar *wimboot_cfgfile =
@@ -740,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)) {
@@ -886,6 +891,7 @@ execute_add_command(struct update_command_journal *j,
 out_destroy_config:
        destroy_capture_config(&config);
 out:
+       FREE(params.cur_path);
        return ret;
 }
 
@@ -1228,7 +1234,7 @@ check_add_command(struct wimlib_update_command *cmd,
        }
 #endif
 
-#ifdef __WIN32__
+#ifdef _WIN32
        /* Check for flags not supported on Windows.  */
        if (add_flags & WIMLIB_ADD_FLAG_UNIX_DATA) {
                ERROR("Capturing UNIX-specific data is not supported on Windows");