ssa_db_helper.c: Eliminating code duplication

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>