From bc0c2843db4dea70251e8c5b4a9272ce40caa7f2 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 6 Apr 2006 17:44:15 +0200 Subject: Check the malloc error Check the malloc error properly. --- oss/pcm_oss.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'oss/pcm_oss.c') 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"); -- cgit