]> andersk Git - gssapi-openssh.git/blobdiff - openssh/openbsd-compat/getrrsetbyname.c
merged OpenSSH 4.7p1 to trunk
[gssapi-openssh.git] / openssh / openbsd-compat / getrrsetbyname.c
index 6c86e02c2ab0805dbe8c7629ba47bf3b0d9b0a96..80af3f5425287724d3439fc12242a1e6fd613862 100644 (file)
@@ -67,13 +67,9 @@ extern int h_errno;
 #endif
 #define _THREAD_PRIVATE(a,b,c) (c)
 
-/* to avoid conflicts where a platform already has _res */
-#ifdef _res
-# undef _res
-#endif
-#define _res   _compat_res
-
+#ifndef HAVE__RES_EXTERN
 struct __res_state _res;
+#endif
 
 /* Necessary functions and macros */
 
@@ -303,10 +299,12 @@ getrrsetbyname(const char *hostname, unsigned int rdclass,
        }
 
        /* allocate memory for signatures */
-       rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
-       if (rrset->rri_sigs == NULL) {
-               result = ERRSET_NOMEMORY;
-               goto fail;
+       if (rrset->rri_nsigs > 0) {
+               rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
+               if (rrset->rri_sigs == NULL) {
+                       result = ERRSET_NOMEMORY;
+                       goto fail;
+               }
        }
 
        /* copy answers & signatures */
This page took 0.069603 seconds and 4 git commands to generate.