diff options
author | Stanislav Malyshev <stas@php.net> | 2015-02-16 06:50:10 +0100 |
---|---|---|
committer | Ferenc Kovacs <tyrael@php.net> | 2015-02-18 20:35:57 +0100 |
commit | 9d55c29b484a7d4df0964636e73b770812f118fa (patch) | |
tree | 429b9d45ad503a6068af2710d62226cb598074c4 | |
parent | a90dc7c559670b25c09dbbd88f258ce598f31178 (diff) | |
download | php-git-9d55c29b484a7d4df0964636e73b770812f118fa.tar.gz |
Port for for bug #68552
-rw-r--r-- | ext/enchant/enchant.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 6ec02cdf84..d7c115e366 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -550,13 +550,12 @@ PHP_FUNCTION(enchant_broker_request_dict) d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag); if (d) { + pos = pbroker->dictcnt++; if (pbroker->dictcnt) { pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt); - pos = pbroker->dictcnt++; } else { pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *)); pos = 0; - pbroker->dictcnt++; } dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict)); @@ -607,14 +606,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict) d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl); if (d) { + pos = pbroker->dictcnt++; if (pbroker->dictcnt) { - pos = pbroker->dictcnt++; pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt); } else { pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *)); pos = 0; - pbroker->dictcnt++; } + dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict)); dict->id = pos; dict->pbroker = pbroker; |