Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed the leaks in poll_target and select_passive_target #5

Merged
merged 1 commit into from

2 participants

@IamBc

Hello! I have been using this wrapper for a few small things here and there and I found that the two mentioned functions are actually leaking.
The fix is actually quite easy. I have tested it and it removes all the leaks I cloud find.

Cheers!

@tenderlove
Owner

Excellent, thank you!

@tenderlove tenderlove merged commit 75a4f85 into tenderlove:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2014
  1. @IamBc
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 ext/nfc/nfc_device.c
View
6 ext/nfc/nfc_device.c
@@ -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);
Something went wrong with that request. Please try again.