Permalink
Browse files

Fixed the leaks in poll and select

  • Loading branch information...
1 parent 704563e commit df646cd3c602068ac60451eb797841e93b7902c5 @IamBc IamBc committed Feb 21, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 ext/nfc/nfc_device.c
View
@@ -30,7 +30,9 @@ static VALUE select_passive_target(VALUE self, VALUE tag)
break;
default:
rb_raise(rb_eRuntimeError, "untested type: %d", mod->nmt);
- }
+ }
+ }else {
+ xfree(ti);
}
return Qfalse;
@@ -70,6 +72,8 @@ static VALUE poll_target(VALUE self, VALUE tag, VALUE poll_nr, VALUE ms)
default:
rb_raise(rb_eRuntimeError, "untested type: %d", mod->nmt);
}
+ }else {
+ xfree(ti);
}
return INT2NUM(code);

0 comments on commit df646cd

Please sign in to comment.