summaryrefslogtreecommitdiff
path: root/openbsd-compat/getrrsetbyname.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-08-29 16:12:29 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-08-29 16:12:29 +1000
commitf00e51d1f2ea01c33d5548b79a86c44036b90aae (patch)
treee9a8979d45a52964ad6555c66c97d861a999822e /openbsd-compat/getrrsetbyname.c
parent11bdc01cfe998294ba828a3a0461e1a49c5288a9 (diff)
- (dtucker) [openbsd-compat/getrrsetbyname.c] Prevent getrrsetbyname from
failing with NOMEMORY if no sigs are returned and malloc(0) returns NULL. From Martin.Kraemer at Fujitsu-Siemens.com; ok djm@
Diffstat (limited to 'openbsd-compat/getrrsetbyname.c')
-rw-r--r--openbsd-compat/getrrsetbyname.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c
index 660427c1f..4e869c4df 100644
--- a/openbsd-compat/getrrsetbyname.c
+++ b/openbsd-compat/getrrsetbyname.c
@@ -277,7 +277,7 @@ getrrsetbyname(const char *hostname, unsigned int rdclass,
277 277
278 /* allocate memory for signatures */ 278 /* allocate memory for signatures */
279 rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); 279 rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
280 if (rrset->rri_sigs == NULL) { 280 if (rrset->rri_nsigs > 0 && rrset->rri_sigs == NULL) {
281 result = ERRSET_NOMEMORY; 281 result = ERRSET_NOMEMORY;
282 goto fail; 282 goto fail;
283 } 283 }