Commit 59939313 authored by Yang Tse's avatar Yang Tse
Browse files

Make usage of calloc()'s arguments consistent with rest of code base

parent 961c504c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ DhcpNameServer
    return ARES_SUCCESS; /* use localhost DNS server */

  nservers = i;
  servers = calloc(sizeof(*servers), i);
  servers = calloc(i, sizeof(struct server_state));
  if (!servers)
     return ARES_ENOMEM;

+1 −1
Original line number Diff line number Diff line
@@ -732,7 +732,7 @@ void ares__send_query(ares_channel channel, struct query *query,
              return;
            }
        }
      sendreq = calloc(sizeof(struct send_request), 1);
      sendreq = calloc(1, sizeof(struct send_request));
      if (!sendreq)
        {
        end_query(channel, query, ARES_ENOMEM, NULL, 0);
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ Curl_cookie_add(struct SessionHandle *data,
#endif

  /* First, alloc and init a new struct for it */
  co = calloc(sizeof(struct Cookie), 1);
  co = calloc(1, sizeof(struct Cookie));
  if(!co)
    return NULL; /* bail out if we're this low on memory */

+1 −1
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@ CURL *curl_easy_duphandle(CURL *incurl)
  bool fail = TRUE;
  struct SessionHandle *data=(struct SessionHandle *)incurl;

  struct SessionHandle *outcurl = calloc(sizeof(struct SessionHandle), 1);
  struct SessionHandle *outcurl = calloc(1, sizeof(struct SessionHandle));

  if(NULL == outcurl)
    return NULL; /* failure */
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
  Curl_reset_reqproto(conn);

  if(!data->state.proto.file) {
    file = calloc(sizeof(struct FILEPROTO), 1);
    file = calloc(1, sizeof(struct FILEPROTO));
    if(!file) {
      free(real_path);
      return CURLE_OUT_OF_MEMORY;
Loading