annotate retrieve.cpp @ 601:82d23418d867

Fix some fd leaks in the command-line binary Strictly speaking, they're not really leaks, because the only codepath that suffers from these leaks exits immediately afterwards. On the other hand, this fix makes valgrind on e.g. tests/0025 happier, going from 5 errors to none.
author mas01cr
date Fri, 14 Aug 2009 16:39:32 +0000
parents 361f3bda6694
children
rev   line source
mas01cr@581 1 extern "C" {
mas01cr@581 2 #include "audioDB_API.h"
mas01cr@581 3 }
mas01cr@581 4 #include "audioDB-internals.h"
mas01cr@581 5
mas01cr@581 6 int audiodb_retrieve_datum(adb_t *adb, const char *key, adb_datum_t *datum) {
mas01cr@581 7 uint32_t index = audiodb_key_index(adb, key);
mas01cr@581 8 if(index == (uint32_t) -1) {
mas01cr@581 9 return 1;
mas01cr@581 10 } else {
mas01cr@581 11 return audiodb_track_id_datum(adb, index, datum);
mas01cr@581 12 }
mas01cr@581 13 }
mas01cr@581 14
mas01cr@581 15 int audiodb_free_datum(adb_t *adb, adb_datum_t *datum) {
mas01cr@581 16 return audiodb_really_free_datum(datum);
mas01cr@581 17 }