Fix use after free

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2013-12-27 22:21:59 +01:00
parent b1e8edf0d6
commit 029364bd30

7
main.c
View file

@ -107,13 +107,12 @@ main(int argc, char* argv[])
return -1;
}
const bool ret = synctex_forward_position(real_path, synctex_fwd);
free(real_path);
if (ret == true) {
if (synctex_forward_position(real_path, synctex_fwd) == true) {
free(real_path);
return 0;
} else {
girara_error("Could not find open instance for '%s'", real_path);
free(real_path);
return -1;
}
}