Skip to content

Commit

Permalink
fix missmatch free/delete in org.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
kuno committed Dec 22, 2012
1 parent 1e28fec commit 22dadd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/org.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ Handle<Value> geoip::Org::lookupSync(const Arguments &args) {
Local<Value> data;
char host_cstr[host_str->Length()];
host_str->WriteAscii(host_cstr);
Org* o = ObjectWrap::Unwrap<geoip::Org>(args.This());
Org * o = ObjectWrap::Unwrap<geoip::Org>(args.This());

uint32_t ipnum = _GeoIP_lookupaddress(host_cstr);
if (ipnum <= 0) {
return scope.Close(Null());
}

char *org = GeoIP_org_by_ipnum(o->db, ipnum);
char * org = GeoIP_org_by_ipnum(o->db, ipnum);
if (org == NULL) {
return scope.Close(Null());
}
Expand All @@ -86,7 +86,7 @@ Handle<Value> geoip::Org::lookupSync(const Arguments &args) {

data = String::New(name);

delete org;
free(org);
free(name);

return scope.Close(data);
Expand Down

0 comments on commit 22dadd9

Please sign in to comment.