if (c->use_localtime_mkdir) {
const char *dir;
char *fn_copy = av_strdup(oc->url);
- if (!fn_copy) {
- return AVERROR(ENOMEM);
- }
dir = av_dirname(fn_copy);
if (ff_mkdir_p(dir) == -1 && errno != EEXIST) {
av_log(oc, AV_LOG_ERROR, "Could not create directory %s with use_localtime_mkdir\n", dir);
- av_free(fn_copy);
+ av_freep(&fn_copy);
return AVERROR(errno);
}
- av_free(fn_copy);
+ av_freep(&fn_copy);
}
} else {
char *filename = NULL;
}
fn_dup = av_strdup(fn);
- if (!fn_dup) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
filename = av_basename(fn);
subdir_name = av_dirname(fn_dup);
/* if %v is present in the file's directory, create sub-directory */
if (av_stristr(dir, "%v") && proto && !strcmp(proto, "file")) {
mod_buf_dup = av_strdup(*s);
- if (!mod_buf_dup) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
dir = av_dirname(mod_buf_dup);
if (ff_mkdir_p(dir) == -1 && errno != EEXIST) {
ret = AVERROR(errno);
int ret = 0;
fn1 = av_strdup(s->url);
- if (!fn1) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
dir = av_dirname(fn1);
/**
*/
if (dir && av_stristr(av_basename(dir), "%v")) {
fn2 = av_strdup(dir);
- if (!fn2) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
dir = av_dirname(fn2);
}