]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
Check the malloc error
authorTakashi Iwai <tiwai@suse.de>
Thu, 6 Apr 2006 15:44:15 +0000 (17:44 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 6 Apr 2006 15:44:15 +0000 (17:44 +0200)
Check the malloc error properly.

oss/pcm_oss.c

index 9e386220026c412c0a3efcef5e1fbec55f9b07b1..847721b6addd0e46f04bd6bd18f0ce7e370e3997 100644 (file)
@@ -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");