- Fixed a massive memory leak in Hipadaba
- Extended the Hdb adapter to support SICSdata - Made the simulated histogram memory driver work properly when data has been set. - Implemented the hfactory command - Removed hdbcommand which was never finsihed
This commit is contained in:
14
hipadaba.c
14
hipadaba.c
@@ -402,7 +402,7 @@ hdbValue MakeHdbText(char *initText){
|
||||
hdbValue result;
|
||||
|
||||
result.dataType = HIPTEXT;
|
||||
result.v.text = initText;
|
||||
result.v.text = strdup(initText);
|
||||
result.arrayLength = strlen(initText);
|
||||
return result;
|
||||
}
|
||||
@@ -854,7 +854,8 @@ int copyHdbValue(hdbValue *source, hdbValue *target){
|
||||
if(target->v.intArray == NULL){
|
||||
return 0;
|
||||
}
|
||||
memset(target->v.intArray,0,source->arrayLength * sizeof(int));
|
||||
memset(target->v.intArray,0,source->arrayLength
|
||||
* sizeof(int));
|
||||
target->arrayLength = source->arrayLength;
|
||||
}
|
||||
if(source->v.intArray != NULL){
|
||||
@@ -865,15 +866,18 @@ int copyHdbValue(hdbValue *source, hdbValue *target){
|
||||
break;
|
||||
case HIPFLOATAR:
|
||||
case HIPFLOATVARAR:
|
||||
if(target->arrayLength != source->arrayLength || target->v.floatArray == NULL){
|
||||
if(target->arrayLength != source->arrayLength
|
||||
|| target->v.floatArray == NULL){
|
||||
if(target->v.floatArray != NULL){
|
||||
free(target->v.floatArray);
|
||||
}
|
||||
target->v.floatArray = malloc(source->arrayLength * sizeof(double));
|
||||
target->v.floatArray =
|
||||
malloc(source->arrayLength * sizeof(double));
|
||||
if(target->v.floatArray == NULL){
|
||||
return 0;
|
||||
}
|
||||
memset(target->v.floatArray,0,source->arrayLength * sizeof(double));
|
||||
memset(target->v.floatArray,0,source->arrayLength *
|
||||
sizeof(double));
|
||||
target->arrayLength = source->arrayLength;
|
||||
}
|
||||
if(source->v.floatArray != NULL){
|
||||
|
||||
Reference in New Issue
Block a user