=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/midi.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/usr.bin/sndiod/midi.c 2015/11/23 18:16:41 1.13 +++ src/usr.bin/sndiod/midi.c 2015/11/25 18:47:12 1.14 @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.13 2015/11/23 18:16:41 ratchov Exp $ */ +/* $OpenBSD: midi.c,v 1.14 2015/11/25 18:47:12 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -427,7 +427,7 @@ struct port *c; c = xmalloc(sizeof(struct port)); - c->path = path; + c->path = xstrdup(path); c->state = PORT_CFG; c->hold = hold; c->midi = midi_new(&port_midiops, c, mode); @@ -457,6 +457,7 @@ #endif } *p = c->next; + xfree(c->path); xfree(c); }