Compare commits

...

3 Commits
1.7.5 ... main

Author SHA1 Message Date
1ce643b0c8
chore: bump patch version 2023-12-12 23:29:23 +01:00
ae7bf076dc
fix: Avoid leaking all kinds of stuff in examples/pack
Apart from potentionally leaking malloced memory on error,
which isn't too bad since we immediately exit afterwards,
we were leaving all opened files dangling, as fclose() was never called.
2023-12-12 23:27:05 +01:00
73c4dce573
fix: Functions implemented in tar.c are no longer implemented in the README 2023-06-18 21:09:35 +02:00
3 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.8..3.22)
project(minitar LANGUAGES C VERSION 1.7.5)
project(minitar LANGUAGES C VERSION 1.7.6)
option(MINITAR_IGNORE_UNSUPPORTED_TYPES "Skip past entries that have unsupported types instead of panicking (deprecated)" OFF)

View File

@ -43,7 +43,7 @@ See [examples](examples/) for more examples using minitar.
## Project structure
The user-facing API (functions defined in `minitar.h` and documented in this README) is implemented in `src/tar.c`. Utility and internally-used functions live in `src/util.c`.
The user-facing API (functions defined in `minitar.h` and documented in [API.md](docs/API.md)) is implemented in `src/tar.c`. Utility and internally-used functions live in `src/util.c`.
## Documentation

View File

@ -47,6 +47,7 @@ int main(int argc, char** argv)
if (!buf)
{
perror("malloc");
fclose(fp);
exit_status = 1;
break;
}
@ -54,8 +55,7 @@ int main(int argc, char** argv)
if (ferror(fp))
{
perror("fread");
exit_status = 1;
break;
goto err;
}
struct stat st;
@ -63,8 +63,7 @@ int main(int argc, char** argv)
if (rc < 0)
{
perror("fstat");
exit_status = 1;
break;
goto err;
}
struct minitar_entry_metadata metadata;
@ -78,6 +77,7 @@ int main(int argc, char** argv)
rc = minitar_write_file_entry(&mp, &metadata, buf);
free(buf);
fclose(fp);
if (rc != 0)
{
@ -87,6 +87,13 @@ int main(int argc, char** argv)
}
arg++;
continue;
err:
free(buf);
fclose(fp);
exit_status = 1;
break;
}
minitar_close_w(&mp);
return exit_status;