You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2015/01/07 15:52:49 UTC
svn commit: r1650075 - /celix/trunk/framework/private/src/filter.c
Author: abroekhuis
Date: Wed Jan 7 14:52:49 2015
New Revision: 1650075
URL: http://svn.apache.org/r1650075
Log:
CELIX-197: Fixed allocation problems in filter.c.
Modified:
celix/trunk/framework/private/src/filter.c
Modified: celix/trunk/framework/private/src/filter.c
URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/filter.c?rev=1650075&r1=1650074&r2=1650075&view=diff
==============================================================================
--- celix/trunk/framework/private/src/filter.c (original)
+++ celix/trunk/framework/private/src/filter.c Wed Jan 7 14:52:49 2015
@@ -317,7 +317,7 @@ char * filter_parseAttr(char * filterStr
}
char * filter_parseValue(char * filterString, int * pos) {
- char * value = strdup("");
+ char *value = calloc(strlen(filterString) + 1, sizeof(*value));
int keepRunning = 1;
while (keepRunning) {
@@ -356,13 +356,12 @@ char * filter_parseValue(char * filterSt
}
array_list_pt filter_parseSubstring(char * filterString, int * pos) {
- char * sub = (char *) malloc(strlen(filterString));
+ char *sub = calloc(strlen(filterString) + 1, sizeof(*sub));
array_list_pt operands = NULL;
int keepRunning = 1;
int size;
arrayList_create(&operands);
- sub[0] = '\0';
while (keepRunning) {
char c = filterString[*pos];