~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzletest.cc

  • Committer: Monty Taylor
  • Date: 2008-12-09 18:56:09 UTC
  • mto: (670.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 672.
  • Revision ID: monty@inaugust.com-20081209185609-xx2horolub26vi8w
Removed two (foo) ? realloc(foo, len) : malloc (len) instances.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1955
1955
  dest->int_dirty= src->int_dirty;
1956
1956
 
1957
1957
  /* Alloc/realloc data for str_val in dest */
1958
 
  if (dest->alloced_len < src->alloced_len &&
1959
 
      !(dest->str_val= dest->str_val
1960
 
        ? (char *)realloc(dest->str_val, src->alloced_len)
1961
 
        : (char *)malloc(src->alloced_len)))
1962
 
    die("Out of memory");
 
1958
  if (dest->alloced_len < src->alloced_len)
 
1959
  {
 
1960
    char *tmpptr= realloc(dest->str_val, src->alloced_len);
 
1961
    if (tmpptr == NULL)
 
1962
      die("Out of memory");
 
1963
    dest->str_val= tmpptr;
 
1964
  }
1963
1965
  else
1964
1966
    dest->alloced_len= src->alloced_len;
1965
1967
 
2011
2013
      static int MIN_VAR_ALLOC= 32;
2012
2014
      v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
2013
2015
        MIN_VAR_ALLOC : new_val_len + 1;
2014
 
      if (!(v->str_val =
2015
 
            v->str_val ? (char *)realloc(v->str_val, v->alloced_len+1)
2016
 
                       : (char *)malloc(v->alloced_len+1)))
 
2016
      char *tmpptr= (char *)realloc(v->str_val, v->alloced_len+1);
 
2017
      if (tmpptr == NULL)
2017
2018
        die("Out of memory");
 
2019
      v->str_val= tmpptr;
2018
2020
    }
2019
2021
    v->str_val_len = new_val_len;
2020
2022
    memcpy(v->str_val, p, new_val_len);