~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/row.cc

  • Committer: Brian Aker
  • Date: 2011-12-16 06:32:39 UTC
  • mto: (2478.1.1 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2474.
  • Revision ID: brian@tangent.org-20111216063239-hgrxmt1ginuvxpqv
Formatting, and valgrind cleanups (just mismatch of free/delete).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Drizzle Client & Protocol Library
 
1
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 
 
2
 *
 
3
 *  Drizzle Client & Protocol Library
3
4
 *
4
5
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
5
6
 * All rights reserved.
75
76
  if (result->row == NULL)
76
77
  {
77
78
    if (drizzle_row_read(result, ret_ptr) == 0 || *ret_ptr != DRIZZLE_RETURN_OK)
 
79
    {
78
80
      return NULL;
 
81
    }
79
82
 
80
83
    result->row= (drizzle_row_t)malloc((sizeof(drizzle_field_t) + sizeof(size_t)) * result->column_count);
81
84
    if (result->row == NULL)
93
96
    field= drizzle_field_buffer(result, &total, ret_ptr);
94
97
    if (*ret_ptr == DRIZZLE_RETURN_ROW_END)
95
98
      break;
 
99
 
96
100
    if (*ret_ptr != DRIZZLE_RETURN_OK)
97
101
    {
98
102
      if (*ret_ptr != DRIZZLE_RETURN_IO_WAIT)
118
122
 
119
123
void drizzle_row_free(drizzle_result_st *result, drizzle_row_t row)
120
124
{
121
 
  uint16_t x;
122
 
 
123
 
  for (x= 0; x < result->column_count; x++)
124
 
      drizzle_field_free(row[x]);
 
125
  for (uint16_t x= 0; x < result->column_count; x++)
 
126
  {
 
127
    drizzle_field_free(row[x]);
 
128
  }
125
129
 
126
130
  free(row);
127
131
}