diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index 57586ebee95..b3518eb123d 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -1203,6 +1203,7 @@ int main( fprintf(stderr, "Error: %s cannot be found\n", filename); + free(buf); DBUG_RETURN(1); } @@ -1211,11 +1212,13 @@ int main( fil_in = open_file(filename); /*If fil_in is NULL, terminate as some error encountered */ if(fil_in == NULL) { + free(buf); DBUG_RETURN(1); } /* Save the current file pointer in pos variable.*/ if (0 != fgetpos(fil_in, &pos)) { perror("fgetpos"); + free(buf); DBUG_RETURN(1); } } @@ -1229,6 +1232,7 @@ int main( while((_access( page_dump_filename, 0)) == 0) { sleep(1); } + free(buf); DBUG_RETURN(0); ); #else DBUG_EXECUTE_IF("innochecksum_cause_mysqld_crash", @@ -1237,6 +1241,7 @@ int main( while(stat(page_dump_filename, &status_buf) == 0) { sleep(1); } + free(buf); DBUG_RETURN(0); ); #endif /* _WIN32 */