File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -178,11 +178,6 @@ static void rb_tinytds_client_reset_userdata(tinytds_client_userdata *userdata)
178
178
userdata -> dbcancel_sent = 0 ;
179
179
userdata -> nonblocking = 0 ;
180
180
userdata -> nonblocking_errors_length = 0 ;
181
- if (userdata -> nonblocking_errors_size ) {
182
- free (userdata -> nonblocking_errors );
183
- }
184
- userdata -> nonblocking_errors = malloc (ERRORS_STACK_INIT_SIZE * sizeof (tinytds_errordata ));
185
- userdata -> nonblocking_errors_size = ERRORS_STACK_INIT_SIZE ;
186
181
}
187
182
188
183
static void rb_tinytds_client_mark (void * ptr ) {
@@ -201,9 +196,6 @@ static void rb_tinytds_client_free(void *ptr) {
201
196
cwrap -> closed = 1 ;
202
197
cwrap -> userdata -> closed = 1 ;
203
198
}
204
- if (cwrap -> userdata -> nonblocking_errors_size ) {
205
- free (cwrap -> userdata -> nonblocking_errors );
206
- }
207
199
xfree (ptr );
208
200
}
209
201
Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ static void dbcancel_ubf(DBPROCESS *client) {
86
86
static void nogvl_setup (DBPROCESS * client ) {
87
87
GET_CLIENT_USERDATA (client );
88
88
userdata -> nonblocking = 1 ;
89
+ userdata -> nonblocking_errors_length = 0 ;
90
+ userdata -> nonblocking_errors = malloc (ERRORS_STACK_INIT_SIZE * sizeof (tinytds_errordata ));
91
+ userdata -> nonblocking_errors_size = ERRORS_STACK_INIT_SIZE ;
89
92
}
90
93
91
94
static void nogvl_cleanup (DBPROCESS * client ) {
@@ -108,7 +111,9 @@ static void nogvl_cleanup(DBPROCESS *client) {
108
111
);
109
112
}
110
113
114
+ free (userdata -> nonblocking_errors );
111
115
userdata -> nonblocking_errors_length = 0 ;
116
+ userdata -> nonblocking_errors_size = 0 ;
112
117
}
113
118
114
119
static RETCODE nogvl_dbsqlok (DBPROCESS * client ) {
You can’t perform that action at this time.
0 commit comments