DEBUG("Reading the WIM file `%s'", in_wim_path);
- w->filename = realpath(in_wim_path, NULL);
- if (!w->filename) {
- ERROR("Failed to allocate memory for WIM filename");
- return WIMLIB_ERR_NOMEM;
- }
-
w->fp = fopen(in_wim_path, "rb");
if (!w->fp) {
return WIMLIB_ERR_OPEN;
}
+ w->filename = realpath(in_wim_path, NULL);
+ if (!w->filename) {
+ ERROR("Failed to allocate memory for WIM filename");
+ return WIMLIB_ERR_NOMEM;
+ }
+
ret = read_header(w->fp, &w->hdr, open_flags);
if (ret != 0)
return ret;