UpnpResolveURL allocates a buffer, copies it to my buffer, and then frees it. Why not give me the pointer directly?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libupnp (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
These lines are in libupnp-
// There is some unnecessary allocation and
// deallocation going on here because of the way
// resolve_rel_url was originally written and used
// in the future it would be nice to clean this up
I was looking here because I wanted to know how thread-safe this function is. Thread safe it is, but now that I've seen this, I have to request this to be added to the API:
int
UpnpResolveURL2( IN const char *BaseURL,
IN const char *RelURL,
OUT char **AbsURL )
{
if( RelURL == NULL || AbsURL == NULL )
return UPNP_E_
*AbsURL = NULL;
*AbsURL = resolve_
if( *AbsURL == NULL ) {
return UPNP_E_INVALID_URL;
}
return UPNP_E_SUCCESS;
}
Can you please add this in a future version? I wonder why it wasn't done like this to begin with, since resolve_rel_url was already doing it this way.
This bug was fixed in the package libupnp - 1:1.6.17-1.1
---------------
libupnp (1:1.6.17-1.1) unstable; urgency=high
* Non-maintainer upload.
* libupnp6-doc Replaces libupnp3-dev (closes: #670894)
-- Julien Cristau <email address hidden> Tue, 08 May 2012 16:59:14 +0200