mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
Fix nID::ToString() leaks in autoregistration.
This commit is contained in:
parent
fbc430ce9a
commit
db84eb691c
@ -225,6 +225,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
|
||||
|
||||
char name[128];
|
||||
char progid[128];
|
||||
char * cid_string;
|
||||
for (i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
|
||||
if(0==PL_strcmp(g_FactoryData[i].mCharsetSrc,"Unicode"))
|
||||
{
|
||||
@ -245,8 +246,9 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
|
||||
|
||||
// register component info
|
||||
// XXX take these KONSTANTS out of here
|
||||
// XXX free the string from "ToString()"
|
||||
sprintf(buff, "%s/%s", "software/netscape/intl/uconv", (g_FactoryData[i].mCID -> ToString()));
|
||||
cid_string = g_FactoryData[i].mCID->ToString();
|
||||
sprintf(buff, "%s/%s", "software/netscape/intl/uconv", cid_string);
|
||||
nsCRT::free(cid_string);
|
||||
res = registry -> AddSubtree(nsIRegistry::Common, buff, &key);
|
||||
if (NS_FAILED(res)) goto done;
|
||||
res = registry -> SetString(key, "source", g_FactoryData[i].mCharsetSrc);
|
||||
|
@ -212,6 +212,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
|
||||
|
||||
char name[128];
|
||||
char progid[128];
|
||||
char * cid_string;
|
||||
for (i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
|
||||
if(0==PL_strcmp(g_FactoryData[i].mCharsetSrc,"Unicode"))
|
||||
{
|
||||
@ -232,8 +233,9 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
|
||||
|
||||
// register component info
|
||||
// XXX take these KONSTANTS out of here
|
||||
// XXX free the string from "ToString()"
|
||||
sprintf(buff, "%s/%s", "software/netscape/intl/uconv", (g_FactoryData[i].mCID -> ToString()));
|
||||
cid_string = g_FactoryData[i].mCID->ToString();
|
||||
sprintf(buff, "%s/%s", "software/netscape/intl/uconv", cid_string);
|
||||
nsCRT::free(cid_string);
|
||||
res = registry -> AddSubtree(nsIRegistry::Common, buff, &key);
|
||||
if (NS_FAILED(res)) goto done;
|
||||
res = registry -> SetString(key, "source", g_FactoryData[i].mCharsetSrc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user