diff options
author | Martin Ettl <ettl.martin78@googlemail.com> | 2014-12-22 19:13:26 (GMT) |
---|---|---|
committer | Martin Ettl <ettl.martin78@googlemail.com> | 2014-12-22 19:13:26 (GMT) |
commit | 5743848928ffaeccaaef24dac051aaa9acf2c4b7 (patch) | |
tree | d7991d0ddd304f9b2e93b6df6ea3d930d3704ea1 /src | |
parent | ed39dab59f8af2c5b42cfac0b3140cf594412121 (diff) | |
download | Doxygen-5743848928ffaeccaaef24dac051aaa9acf2c4b7.zip Doxygen-5743848928ffaeccaaef24dac051aaa9acf2c4b7.tar.gz Doxygen-5743848928ffaeccaaef24dac051aaa9acf2c4b7.tar.bz2 |
Fix potential null pointer dereference in src/classdef.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 5c42f57..0da7cf5 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -3123,18 +3123,19 @@ void ClassDef::mergeCategory(ClassDef *category) Protection prot = mi->prot; //if (makePrivate) prot = Private; MemberDef *newMd = mi->memberDef->deepCopy(); - //printf("Copying member %s\n",mi->memberDef->name().data()); - newMd->moveTo(this); - - MemberInfo *newMi=new MemberInfo(newMd,prot,mi->virt,mi->inherited); - newMi->scopePath=mi->scopePath; - newMi->ambigClass=mi->ambigClass; - newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope; - newMni->append(newMi); - - // also add the newly created member to the global members list if (newMd) { + //printf("Copying member %s\n",mi->memberDef->name().data()); + newMd->moveTo(this); + + MemberInfo *newMi=new MemberInfo(newMd,prot,mi->virt,mi->inherited); + newMi->scopePath=mi->scopePath; + newMi->ambigClass=mi->ambigClass; + newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope; + newMni->append(newMi); + + // also add the newly created member to the global members list + MemberName *mn; QCString name = newMd->name(); if ((mn=Doxygen::memberNameSDict->find(name))) @@ -3147,17 +3148,17 @@ void ClassDef::mergeCategory(ClassDef *category) mn->append(newMd); Doxygen::memberNameSDict->append(name,mn); } + + newMd->setCategory(category); + newMd->setCategoryRelation(mi->memberDef); + mi->memberDef->setCategoryRelation(newMd); + if (makePrivate || isExtension) + { + newMd->makeImplementationDetail(); + } + internalInsertMember(newMd,prot,FALSE); } - - newMd->setCategory(category); - newMd->setCategoryRelation(mi->memberDef); - mi->memberDef->setCategoryRelation(newMd); - if (makePrivate || isExtension) - { - newMd->makeImplementationDetail(); - } - internalInsertMember(newMd,prot,FALSE); - } + } // add it to the dictionary dstMnd->append(newMni->memberName(),newMni); |