Free Hero Mesh

Check-in [95af598a76]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Fix a mistake in picedit.c with freeing memory after saving a multidependent picture.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 95af598a7620a120e1836d449717db028fc84800
User & Date: user on 2022-08-05 08:52:13
Other Links: manifest | tags
Context
2022-08-06
07:47
Implement CONFIG_OMIT_SOUND check-in: c8c053656e user: user tags: trunk
2022-08-05
08:52
Fix a mistake in picedit.c with freeing memory after saving a multidependent picture. check-in: 95af598a76 user: user tags: trunk
06:22
The previous attempted fix of trying to call a macro whose definition is empty had a problem with defining new macros. Instead, make a macro with a single TF_MACRO+TF_ABNORMAL token if it is empty, and skip the TF_MACRO+TF_ABNORMAL token during expansion. check-in: 4ce94e1d08 user: user tags: trunk
Changes

Modified picedit.c from [2327f052d7] to [583dab5e00].

1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
    mpict=malloc(sizeof(MultiDependent));
    if(!mpict) fatal("Allocation failed\n");
    load_multidependent(data,n,mpict);
    fp=open_memstream((char**)&buf,&size);
    if(!fp) fatal("Cannot open memory stream\n");
    edit_multidependent(mpict,name);
    save_multidependent(fp,mpict);
    free(dpict);
    fclose(fp);
    if(!buf || !size) fatal("Allocation failed\n");
  }
  free(name);
  if(i=sqlite3_prepare_v2(userdb,"UPDATE `PICEDIT` SET `DATA`=?2 WHERE ID=?1;",-1,&st,0)) {
    screen_message(sqlite3_errmsg(userdb));
    free(buf);







|







1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
    mpict=malloc(sizeof(MultiDependent));
    if(!mpict) fatal("Allocation failed\n");
    load_multidependent(data,n,mpict);
    fp=open_memstream((char**)&buf,&size);
    if(!fp) fatal("Cannot open memory stream\n");
    edit_multidependent(mpict,name);
    save_multidependent(fp,mpict);
    free(mpict);
    fclose(fp);
    if(!buf || !size) fatal("Allocation failed\n");
  }
  free(name);
  if(i=sqlite3_prepare_v2(userdb,"UPDATE `PICEDIT` SET `DATA`=?2 WHERE ID=?1;",-1,&st,0)) {
    screen_message(sqlite3_errmsg(userdb));
    free(buf);