diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2015-11-25 18:47:13 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2015-11-25 18:47:13 +0000 |
commit | 7236e5707f3063eb299660b68567a871aa5f2cf0 (patch) | |
tree | c9734f3a84c94051617c9994c9acc65f6d665329 /usr.bin/sndiod/midi.c | |
parent | 79efeecd9eba3807119e4d2512c2fe47b039609b (diff) |
Allocate device names in the heap, so they can be generated.
Diffstat (limited to 'usr.bin/sndiod/midi.c')
-rw-r--r-- | usr.bin/sndiod/midi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/sndiod/midi.c b/usr.bin/sndiod/midi.c index 2c7b4c1d01d..ad73fc56671 100644 --- a/usr.bin/sndiod/midi.c +++ b/usr.bin/sndiod/midi.c @@ -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 <alex@caoua.org> * @@ -427,7 +427,7 @@ port_new(char *path, unsigned int mode, int hold) 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 @@ port_del(struct port *c) #endif } *p = c->next; + xfree(c->path); xfree(c); } |