MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / new_full_db_res

Function new_full_db_res

modules/db_http/http_dbase.c:310–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308
309
310db_res_t * new_full_db_res(int rows, int cols)
311{
312 db_res_t * res;
313 int i;
314
315 res = db_new_result();
316
317 if( res == NULL)
318 {
319 LM_ERR("Error allocating db result\n");
320 return NULL;
321 }
322
323 if( db_allocate_columns(res,cols) < 0)
324 {
325 LM_ERR("Error allocating db result columns\n");
326 pkg_free(res);
327 return NULL;
328 }
329 res->col.n = cols;
330
331 if( db_allocate_rows(res,rows) < 0 )
332 {
333 LM_ERR("Error allocating db result rows\n");
334 db_free_columns( res );
335 pkg_free(res);
336 return NULL;
337 }
338
339 res->n = rows;
340 res->res_rows = rows;
341 res->last_row = rows;
342
343
344 for( i=0;i<rows;i++)
345 res->rows[i].n = cols;
346
347 return res;
348}
349
350
351

Callers 1

form_resultFunction · 0.85

Calls 4

db_new_resultFunction · 0.85
db_allocate_columnsFunction · 0.85
db_allocate_rowsFunction · 0.85
db_free_columnsFunction · 0.85

Tested by

no test coverage detected