Changeset 75007aa in subsurface


Ignore:
Timestamp:
Apr 21, 2017, 6:52:13 AM (7 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
441cfb3
Parents:
329a6bc0
git-author:
Salvador Cuñat <salvador.cunat@…> (04/12/17 12:54:47)
git-committer:
Dirk Hohndel <dirk@…> (04/21/17 06:52:13)
Message:

smtk-import reuse pre-existent code and fix leak

Use update_event_name() for bookmarks merge and free temp string.

Signed-off-by: Salvador Cuñat <salvador.cunat@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smtk-import/smartrak.c

    r329a6bc0 r75007aa  
    688688                        tmp = strdup(col[2]->bind_ptr);
    689689                        ev = find_bookmark(d->dc.events, time);
    690                         if (ev != NULL) {
    691                                 memset(&ev->name, 0, strlen(tmp) + 1);
    692                                 memcpy(ev->name, tmp, strlen(tmp));
    693                         } else
     690                        if (ev)
     691                                update_event_name(d, ev, tmp);
     692                        else
    694693                                if (!add_event(&d->dc, time, SAMPLE_EVENT_BOOKMARK, 0, 0, tmp))
    695694                                        report_error("[smtk-import] Error - Couldn't add bookmark, dive %d, Name = %s",
     
    697696                }
    698697        }
     698        free(tmp);
    699699        smtk_free(bound_values, table->num_cols);
    700700        mdb_free_tabledef(table);
Note: See TracChangeset for help on using the changeset viewer.