You could always do this:
That will read in the entire file 10 bytes at a time. The most space you'll be wasting is sizeof(*buffer) * 10 bytes. The number doesn't have to be 10. You can make it whatever you want, but the lower the number the more freads() there will be. And the more freads() there are, the less efficient it will be. But if you make the number higher then you'll run the risk of wasting more space.
char *buffer = malloc(10), *tmp;
unsigned int n_allocs = 1;
while(fread(buffer + ((n_allocs - 1) * 10), 1, 10, in) == 10)
tmp = realloc(buffer, n_allocs * 10);
// Handle memory allocation error
buffer = tmp;
// Do stuff with buffer
Also, the above code could use better error checking, but it serves as an algorithm example.