From: Takashi Iwai Date: Thu, 6 Apr 2006 15:44:15 +0000 (+0200) Subject: Check the malloc error X-Git-Tag: v1.0.11rc5~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=bc0c2843db4dea70251e8c5b4a9272ce40caa7f2;p=alsa-plugins.git Check the malloc error Check the malloc error properly. --- 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");