Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/intl/lang_tdb.c

    r740 r988  
    104104        static int initialised;
    105105        time_t loadtime;
    106         bool result = False;
     106        bool result = false;
     107        char *dpath = NULL;
     108        char *lpath = NULL;
    107109
    108110        /* we only want to init once per process, unless given
     
    131133                return True;
    132134
    133         if (asprintf(&msg_path, "%s.msg",
    134                      data_path((const char *)lang)) == -1) {
     135        dpath = data_path(talloc_tos(), (const char *)lang);
     136        if (dpath == NULL) {
     137                goto done;
     138        }
     139
     140        if (asprintf(&msg_path, "%s.msg", dpath) == -1) {
    135141                DEBUG(0, ("asprintf failed\n"));
    136142                goto done;
     
    142148                goto done;
    143149        }
    144        
    145         if (asprintf(&path, "%s%s.tdb", lock_path("lang_"), lang) == -1) {
     150
     151        lpath = lock_path("lang_");
     152        if (lpath == NULL) {
     153                goto done;
     154        }
     155
     156        if (asprintf(&path, "%s%s.tdb", lpath, lang) == -1) {
    146157                DEBUG(0, ("asprintf failed\n"));
    147158                goto done;
     
    176187        SAFE_FREE(msg_path);
    177188        SAFE_FREE(path);
     189        TALLOC_FREE(lpath);
     190        TALLOC_FREE(dpath);
    178191
    179192        return result;
     
    238251{
    239252        if (!tdb) return;
    240         free((void *)msgstr);
     253        free(discard_const_p(void, msgstr));
    241254}
    242255
Note: See TracChangeset for help on using the changeset viewer.