Browse Source

Do not try to duplicate an array when source equals to destination.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
19d0628afc
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      engine/hashmap.c

+ 6
- 0
engine/hashmap.c View File

@ -1004,6 +1004,12 @@ PH7_PRIVATE sxi32 PH7_HashmapDup(ph7_hashmap *pSrc, ph7_hashmap *pDest) {
ph7_value sKey, *pVal;
sxi32 rc;
sxu32 n;
if(pSrc == pDest) {
/* This should NOT really happen, but never try to duplicate
* an array when source and the destination are the same arrays.
*/
return SXRET_OK;
}
/* Point to the first inserted entry in the source */
pEntry = pSrc->pFirst;
/* Perform the duplication */


Loading…
Cancel
Save