summaryrefslogtreecommitdiffstats
path: root/oss
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-04-06 17:44:15 +0200
committerTakashi Iwai <tiwai@suse.de>2006-04-06 17:44:15 +0200
commitbc0c2843db4dea70251e8c5b4a9272ce40caa7f2 (patch)
treee1c14c44f4492c5976c931f86778404a85717d78 /oss
parent3cd8d134e5f94d08c33178a594519eadbbf7eaf8 (diff)
Check the malloc error
Check the malloc error properly.
Diffstat (limited to 'oss')
-rw-r--r--oss/pcm_oss.c5
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");