Permalink
Browse files

Fix double-free on bad 'open', fixes issue #3

  • Loading branch information...
1 parent 2a301dd commit 69ea924a1787aac9833c60dc45243961154bbb7d @Vagabond committed Nov 24, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 c_src/syslog_drv.c
  2. BIN rebar
View
@@ -97,8 +97,10 @@ static void syslogdrv_output(ErlDrvData handle, char *buff, ErlDrvSizeT bufflen)
if (!strcmp("open", operation)) {
int size, type;
- if (d->ident)
+ if (d->ident) {
free(d->ident); /* free old ident string */
+ d->ident = NULL;
+ }
ei_get_type(buff, &index, &type, &size);
if (type == ERL_STRING_EXT) {
View
BIN rebar
Binary file not shown.

0 comments on commit 69ea924

Please sign in to comment.