Mercurial > hg > audiodb
comparison audioDB.cpp @ 507:e7fd50483311
Free bits of the datum constructed in audioDB::query.
We're not quite safe: error calls between allocation of some of these
bits and pieces and their use will cause failure... but not freeing
things here is definitely wrong.
author | mas01cr |
---|---|
date | Tue, 13 Jan 2009 21:37:10 +0000 |
parents | da4b76190d43 |
children | 23c47e118bc6 |
comparison
equal
deleted
inserted
replaced
506:33913e11348a | 507:e7fd50483311 |
---|---|
923 error("unrecognized queryType"); | 923 error("unrecognized queryType"); |
924 } | 924 } |
925 | 925 |
926 adb_query_results_t *rs = audiodb_query_spec(adb, &qspec); | 926 adb_query_results_t *rs = audiodb_query_spec(adb, &qspec); |
927 | 927 |
928 // FIXME: free bits of datum if !query_from_key | 928 // FIXME: we don't yet free everything up if there are error |
929 // conditions during the construction of the query spec (including | |
930 // the datum itself). | |
931 if(datum.data) { | |
932 free(datum.data); | |
933 datum.data = NULL; | |
934 } | |
935 if(datum.power) { | |
936 free(datum.data); | |
937 datum.data = NULL; | |
938 } | |
939 if(datum.times) { | |
940 free(datum.data); | |
941 datum.data = NULL; | |
942 } | |
929 | 943 |
930 if(rs == NULL) { | 944 if(rs == NULL) { |
931 error("audiodb_query_spec failed"); | 945 error("audiodb_query_spec failed"); |
932 } | 946 } |
933 | 947 |