~mysql/mysql-server/5.7

« back to all changes in this revision

Viewing changes to sql-common/client.c

  • Committer: Vamsikrishna Bhagi
  • Date: 2014-03-04 05:19:40 UTC
  • Revision ID: vamsikrishna.bhagi@oracle.com-20140304051940-j2qqf4bfehonesxw
WL#4797 Extending protocol's OK packet

Fixed memory leak issues reported by valgrind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
678
678
    {
679
679
      /*
680
680
        Since nodes were multi-alloced, we don't need to free the data
681
 
        separately.
 
681
        separately. But the str member in data needs to be freed.
682
682
      */
 
683
      LIST *tmp_list= info->info_list[i].head_node;
 
684
      while (tmp_list)
 
685
      {
 
686
        LEX_STRING *tmp= (LEX_STRING *)(tmp_list)->data;
 
687
        if (tmp->str)
 
688
          my_free(tmp->str);
 
689
        tmp_list= tmp_list->next;
 
690
      }
683
691
      list_free(info->info_list[i].head_node, (uint) 0);
684
692
    }
685
693
  }
4653
4661
      simple_command(mysql,COM_QUIT,(uchar*) 0,0,1);
4654
4662
      end_server(mysql);                        /* Sets mysql->net.vio= 0 */
4655
4663
    }
 
4664
    if (mysql->extension)
 
4665
      mysql_extension_free(mysql->extension);
4656
4666
    mysql_close_free_options(mysql);
4657
4667
    mysql_close_free(mysql);
4658
4668
    mysql_detach_stmt_list(&mysql->stmts, "mysql_close");
4660
4670
    if (mysql->thd)
4661
4671
      (*mysql->methods->free_embedded_thd)(mysql);
4662
4672
#endif
4663
 
    if (mysql->extension)
4664
 
      mysql_extension_free(mysql->extension);
4665
 
    mysql->extension= NULL;
4666
4673
    if (mysql->free_me)
4667
4674
      my_free(mysql);
4668
4675
  }