Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/decomp_miniz.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ static int open_miniz(frogfs_fh_t *f, unsigned int flags)
/* gzip */
if (*(p + 2) != 8) {
LOGE("unsupported gzip compression method");
free(priv);
return -1;
}
priv->data += 10;
Expand Down
4 changes: 4 additions & 0 deletions src/frogfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ const frogfs_entry_t *frogfs_get_entry(const frogfs_fs_t *fs, const char *path)
do {
entry = (const void *) fs->head + e->offs;
char *match = frogfs_get_path(fs, entry);
if (!match) {
/* out of memory */
return NULL;
}
if (strcmp(path, match) == 0) {
free(match);
LOGV("entry %d", middle);
Expand Down
4 changes: 4 additions & 0 deletions src/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ static DIR* frogfs_vfs_opendir(void *ctx, const char *path)
{
frogfs_vfs_t *vfs = (frogfs_vfs_t *) ctx;
frogfs_vfs_dh_t *dh = malloc(sizeof(*dh));
if (!dh) {
return NULL;
}

const frogfs_entry_t *entry = frogfs_get_entry(vfs->fs, path);
if (entry == NULL) {
free(dh);
return NULL;
}

Expand Down