diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-04-06 17:44:15 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2006-04-06 17:44:15 +0200 |
commit | bc0c2843db4dea70251e8c5b4a9272ce40caa7f2 (patch) | |
tree | e1c14c44f4492c5976c931f86778404a85717d78 | |
parent | 3cd8d134e5f94d08c33178a594519eadbbf7eaf8 (diff) |
Check the malloc error
Check the malloc error properly.
-rw-r--r-- | oss/pcm_oss.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/oss/pcm_oss.c b/oss/pcm_oss.c index 9e38622..847721b 100644 --- a/oss/pcm_oss.c +++ b/oss/pcm_oss.c @@ -378,6 +378,11 @@ SND_PCM_PLUGIN_DEFINE_FUNC(oss) } oss = calloc(1, sizeof(*oss)); + if (! oss) { + SNDERR("cannot allocate"); + return -ENOMEM; + } + oss->device = strdup(device); if (oss->device == NULL) { SNDERR("cannot allocate"); |