IMHO wouldn't
```c
if (resolved_path != NULL) {
    ret = resolved_path;
} else {
    ret = malloc(_MAX_PATH);
}
```

be slightly cleaner here?