Merge pull request #82 from howerj/master
Fix minor memory leak, fix non-compliance with ANSI standard
This commit is contained in:
6
mpc.c
6
mpc.c
@@ -885,7 +885,7 @@ enum {
|
||||
MPC_TYPE_AND = 24,
|
||||
|
||||
MPC_TYPE_CHECK = 25,
|
||||
MPC_TYPE_CHECK_WITH = 26,
|
||||
MPC_TYPE_CHECK_WITH = 26
|
||||
};
|
||||
|
||||
typedef struct { char *m; } mpc_pdata_fail_t;
|
||||
@@ -2210,9 +2210,9 @@ static mpc_val_t *mpcf_re_range(mpc_val_t *x) {
|
||||
int comp = s[0] == '^' ? 1 : 0;
|
||||
char *range = calloc(1,1);
|
||||
|
||||
if (s[0] == '\0') { free(x); return mpc_fail("Invalid Regex Range Expression"); }
|
||||
if (s[0] == '\0') { free(range); free(x); return mpc_fail("Invalid Regex Range Expression"); }
|
||||
if (s[0] == '^' &&
|
||||
s[1] == '\0') { free(x); return mpc_fail("Invalid Regex Range Expression"); }
|
||||
s[1] == '\0') { free(range); free(x); return mpc_fail("Invalid Regex Range Expression"); }
|
||||
|
||||
for (i = comp; i < strlen(s); i++){
|
||||
|
||||
|
Reference in New Issue
Block a user