Fix a memory leak in an error path found by Maxime Villard's
authorjsg <jsg@openbsd.org>
Tue, 28 Apr 2015 14:07:47 +0000 (14:07 +0000)
committerjsg <jsg@openbsd.org>
Tue, 28 Apr 2015 14:07:47 +0000 (14:07 +0000)
Brainy Code Scanner.

sys/dev/ic/aic6915.c

index 6d1e0c3..729312f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: aic6915.c,v 1.14 2014/12/22 02:28:51 tedu Exp $       */
+/*     $OpenBSD: aic6915.c,v 1.15 2015/04/28 14:07:47 jsg Exp $        */
 /*     $NetBSD: aic6915.c,v 1.15 2005/12/24 20:27:29 perry Exp $       */
 
 /*-
@@ -405,6 +405,7 @@ sf_start(struct ifnet *ifp)
                        if (error) {
                                printf("%s: unable to load Tx buffer, "
                                    "error = %d\n", sc->sc_dev.dv_xname, error);
+                               m_freem(m);
                                break;
                        }
                }