Changeset: 49dede0afae4 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=49dede0afae4 Modified Files: monetdb5/mal/mal_box.c monetdb5/modules/mal/mat.c Branch: Jan2014 Log Message:
Coverity issues diffs (45 lines): diff --git a/monetdb5/mal/mal_box.c b/monetdb5/mal/mal_box.c --- a/monetdb5/mal/mal_box.c +++ b/monetdb5/mal/mal_box.c @@ -679,9 +679,10 @@ prepareSaveBox(Box box, str *boxfile, st #define S_IRUSR 0400 #define S_IWUSR 0200 #endif - if (f != NULL) - chmod(*boxfile, (S_IRUSR | S_IWUSR)); - else + if (f != NULL){ + if( chmod(*boxfile, (S_IRUSR | S_IWUSR)) ) + showException(GDKout, MAL,"box.saveBox", "can not change box file mode"); + } else showException(GDKout, MAL,"box.saveBox", "can not create box file"); if (f == NULL) { GDKfree(*boxfile); *boxfile= NULL; @@ -759,7 +760,8 @@ loadBox(str name) str msg; snprintf(boxfile, PATHLENGTH, "%s%cbox", GDKgetenv("gdk_dbpath"), DIR_SEP); - mkdir(boxfile,0755); /* ignore errors */ + if( mkdir(boxfile,0755) ) + return ; /* ignore errors */ i = strlen(boxfile); snprintf(boxfile + i, PATHLENGTH - i, "%c%s.box", DIR_SEP, name); #ifdef DEBUG_MAL_BOX diff --git a/monetdb5/modules/mal/mat.c b/monetdb5/modules/mal/mat.c --- a/monetdb5/modules/mal/mat.c +++ b/monetdb5/modules/mal/mat.c @@ -1642,11 +1642,9 @@ MATsort(Client cntxt, MalBlkPtr mb, MalS } } error: - if (bats) { - for (i=0; i<len && bats[i]; i++) - BBPunfix(bats[i]->batCacheid); - GDKfree(bats); - } + for (i=0; i<len && bats[i]; i++) + BBPunfix(bats[i]->batCacheid); + GDKfree(bats); if (map && res) { map->tsorted = 0; map->trevsorted = 0; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list