Explorar el Código

- another error condition fix for a problem that gets introduced by a
recent change: don't try to free memory in the row_buf that don't
belong to us anymore
- reported by Bayan Towfiq, bayan at flowroute dot com
- remove row_buf[col] NULL assignment that was not executed anyway


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5438 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt hace 17 años
padre
commit
70764fb02a
Se han modificado 1 ficheros con 0 adiciones y 9 borrados
  1. 0 9
      modules/db_postgres/km_res.c

+ 0 - 9
modules/db_postgres/km_res.c

@@ -256,19 +256,10 @@ int db_postgres_convert_rows(const db_con_t* _h, db_res_t* _r)
 		if(db_postgres_convert_row(_h, _r, &(RES_ROWS(_r)[row - RES_LAST_ROW(_r)]), row_buf)<0){
 			LM_ERR("failed to convert row #%d\n",  row);
 			RES_ROW_N(_r) = row - RES_LAST_ROW(_r);
-			for (col = 0; col < RES_COL_N(_r); col++) {
-				LM_DBG("freeing row_buf[%d] at %p\n", col, row_buf[col]);
-				pkg_free(row_buf[col]);
-			}
 			LM_DBG("freeing row buffer at %p\n", row_buf);
 			pkg_free(row_buf);
 			db_free_rows(_r);
 			return -4;
-			/*
-			 * The following housekeeping may not be technically required, but it
-			 * is a good practice to NULL pointer fields that are no longer valid.
-			 */
-			row_buf[col] = (char *)NULL;
 		}
 	}