summaryrefslogtreecommitdiff
path: root/openbsd-compat/getrrsetbyname.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/getrrsetbyname.c')
-rw-r--r--openbsd-compat/getrrsetbyname.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c
index 6c86e02c2..07231d005 100644
--- a/openbsd-compat/getrrsetbyname.c
+++ b/openbsd-compat/getrrsetbyname.c
@@ -303,10 +303,12 @@ getrrsetbyname(const char *hostname, unsigned int rdclass,
303 } 303 }
304 304
305 /* allocate memory for signatures */ 305 /* allocate memory for signatures */
306 rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); 306 if (rrset->rri_nsigs > 0) {
307 if (rrset->rri_sigs == NULL) { 307 rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
308 result = ERRSET_NOMEMORY; 308 if (rrset->rri_sigs == NULL) {
309 goto fail; 309 result = ERRSET_NOMEMORY;
310 goto fail;
311 }
310 } 312 }
311 313
312 /* copy answers & signatures */ 314 /* copy answers & signatures */