mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Fixed strdup
This commit is contained in:
parent
82929cd852
commit
f563268fac
1 changed files with 5 additions and 2 deletions
|
|
@ -423,6 +423,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, const char *fname, int
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fname)
|
||||||
file->fname = strdup(fname);
|
file->fname = strdup(fname);
|
||||||
file->fd = fd;
|
file->fd = fd;
|
||||||
file->format = format;
|
file->format = format;
|
||||||
|
|
@ -431,6 +432,8 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, const char *fname, int
|
||||||
|
|
||||||
pcm = calloc(1, sizeof(snd_pcm_t));
|
pcm = calloc(1, sizeof(snd_pcm_t));
|
||||||
if (!pcm) {
|
if (!pcm) {
|
||||||
|
if (fname)
|
||||||
|
free(file->fname);
|
||||||
free(file);
|
free(file);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue