Skip to content
Merged
Changes from 2 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
7 changes: 2 additions & 5 deletions src/runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ extern int sqfs_opt_proc(void* data, const char* arg, int key, struct fuse_args*
#include <fnmatch.h>
#include <sys/mman.h>
#include <stdint.h>
#include <libgen.h>

typedef struct {
uint32_t lo;
Expand Down Expand Up @@ -865,10 +864,8 @@ bool rm_recursive(const char* const path) {
void build_mount_point(char* mount_dir, const char* const argv0, char const* const temp_base, const size_t templen) {
const size_t maxnamelen = 6;

// need to copy argv0 as it's a const value, basename intends to modify it
char* argv0_copy = strdup(argv0);
char* path_basename = basename(argv0_copy);
free(argv0_copy);
char* path_basename;
path_basename = basename(argv0);

size_t namelen = strlen(path_basename);
// limit length of tempdir name
Expand Down