You've declared a pointer to a statfs
struct but don't actually have space allocated for such a struct. The pointer points off into nowhereland. It's uninitialized, it doesn't point anywhere legal.
struct statfs stat;
if (statfs64("/tmp", &stat) == -1) {
perror("statfs64");
}
else {
printf("%lu\n", stat.f_bfree * stat.f_bsize);
}