nicer return value.

git-svn-id: file:///svn/unbound/trunk@3020 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2013-11-27 10:07:33 +00:00
parent 5421d424ac
commit 17935c9144

View file

@ -169,8 +169,7 @@ uint8_t* ldns_str2wire_dname(const char* str, size_t* len)
*len = sizeof(dname);
if(ldns_str2wire_dname_buf(str, dname, len) == 0) {
uint8_t* r = (uint8_t*)malloc(*len);
if(r) memcpy(r, dname, *len);
return r;
if(r) return memcpy(r, dname, *len);
}
*len = 0;
return NULL;