diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2010-06-04 00:50:04 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2010-06-04 00:50:04 +0200 |
commit | 0f6f7b770b84bd02d8c94c84ed9da78bc11ba8ca (patch) | |
tree | 82ea876c1428d44d6e3c16d70e785c70ed32d0c6 /src | |
parent | 5f6291d6e4cd7bce5fba0f3c0a76e8b79be14c9b (diff) | |
download | librcc-0f6f7b770b84bd02d8c94c84ed9da78bc11ba8ca.tar.gz librcc-0f6f7b770b84bd02d8c94c84ed9da78bc11ba8ca.tar.bz2 librcc-0f6f7b770b84bd02d8c94c84ed9da78bc11ba8ca.tar.xz librcc-0f6f7b770b84bd02d8c94c84ed9da78bc11ba8ca.zip |
Fix clean-up in the case of context initialization failure (call rccFreeContext instead of rccFree)
Diffstat (limited to 'src')
-rw-r--r-- | src/librcc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librcc.c b/src/librcc.c index d880433..c501b16 100644 --- a/src/librcc.c +++ b/src/librcc.c @@ -82,7 +82,7 @@ rcc_compiled_configuration rccGetCompiledConfiguration() { return &compiled_configuration; } -int rccInit() { +int rccInit(void) { int err; unsigned long i, rpos; @@ -126,7 +126,7 @@ int rccInit() { return 0; } -void rccFree() { +void rccFree(void) { if (rcc_default_ctx) { rccFreeContext(rcc_default_ctx); rcc_default_ctx = NULL; @@ -233,7 +233,7 @@ rcc_context rccCreateContext(const char *locale_variable, unsigned int max_langu if (locale_variable) { if (strlen(locale_variable)>=RCC_MAX_VARIABLE_CHARS) { - rccFree(ctx); + rccFreeContext(ctx); return NULL; } strcpy(ctx->locale_variable, locale_variable); @@ -251,7 +251,7 @@ rcc_context rccCreateContext(const char *locale_variable, unsigned int max_langu rccRegisterLanguage(ctx, rcc_default_languages+i); if (max_languages < i) { - rccFree(ctx); + rccFreeContext(ctx); return NULL; } @@ -266,7 +266,7 @@ rcc_context rccCreateContext(const char *locale_variable, unsigned int max_langu rccRegisterClass(ctx, defclasses+i); if (max_classes < i) { - rccFree(ctx); + rccFreeContext(ctx); return NULL; } } |