Previous 15994 Revisions Next

r7939 Thursday 29th April, 2010 at 21:08:48 UTC by Firewave
[MESS/NEWUI/WIMGTOOL] Fixed free calls for stronv.c functions
[src/mess]image.c zippath.c
[src/mess/osd/windows]dialog.c menu.c opcntrl.c winutils.c
[src/mess/tools/imgtool/windows]assocdlg.c wimgtool.c
[src/mess/tools/messdocs]messdocs.c

src/mess/tools/messdocs/messdocs.c
r7938r7939
109109
110110done:
111111   if (tempstr)
112      free(tempstr);
112      osd_free(tempstr);
113113   return filerr;
114114}
115115
r7938r7939
137137
138138done:
139139   if (tempstr)
140      free(tempstr);
140      osd_free(tempstr);
141141   return filerr;
142142}
143143
src/mess/tools/imgtool/windows/assocdlg.c
r7938r7939
9797            style = WS_CHILD | WS_VISIBLE | BS_CHECKBOX | BS_AUTOCHECKBOX;
9898            t_extension = tstring_from_utf8(dlginfo->extensions[i]);
9999            _sntprintf(buf, ARRAY_LENGTH(buf), TEXT(".%s"), t_extension);
100            free(t_extension);
100            osd_free(t_extension);
101101
102102            control = CreateWindow(TEXT("BUTTON"), buf, style,
103103                xmargin, y, width, height, dialog, NULL, NULL, NULL);
r7938r7939
141141
142142                  t_extension = tstring_from_utf8(dlginfo->extensions[i]);
143143                  _sntprintf(buf, ARRAY_LENGTH(buf), TEXT(".%s"), t_extension);
144                  free(t_extension);
144                  osd_free(t_extension);
145145                  currently_set = win_is_extension_associated(&assoc_info, buf);
146146
147147                  if (is_set && !currently_set)
src/mess/tools/imgtool/windows/wimgtool.c
r7938r7939
8282   if (t_filename != NULL)
8383   {
8484      result = GetFileAttributes(t_filename);
85      global_free(t_filename);
85      osd_free(t_filename);
8686   }
8787   return result;
8888}
r7938r7939
336336      {
337337         t_extension = tstring_from_utf8(extension);
338338         _tcscat(file_path, t_extension);
339         global_free(t_extension);
339         osd_free(t_extension);
340340      }
341341
342342      file = CreateFile(file_path, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL);
r7938r7939
457457
458458   new_index = ListView_InsertItem(info->listview, &lvi);
459459
460   global_free(t_entry_filename);
460   osd_free(t_entry_filename);
461461
462462   if (entry->directory)
463463   {
r7938r7939
503503   {
504504      TCHAR *t_tempstr = tstring_from_utf8(entry->attr);
505505      ListView_SetItemText(info->listview, new_index, column_index++, t_tempstr);
506      global_free(t_tempstr);
506      osd_free(t_tempstr);
507507   }
508508   if (entry->corrupt)
509509   {
r7938r7939
597597
598598   tempstr = tstring_from_utf8(size_buf);
599599   SendMessage(info->statusbar, SB_SETTEXT, 2, (LPARAM) tempstr);
600   global_free(tempstr);
600   osd_free(tempstr);
601601
602602done:
603603   if (imageenum)
r7938r7939
635635      // get file title from Windows
636636      t_filename = tstring_from_utf8(info->filename);
637637      GetFileTitle(t_filename, file_title_buf, ARRAY_LENGTH(file_title_buf));
638      global_free(t_filename);
638      osd_free(t_filename);
639639      utf8_file_title = utf8_from_tstring(file_title_buf);
640640
641641      // get info from image
r7938r7939
672672      statusbar_text[0] = imgtool_basename((char *) info->filename);
673673      statusbar_text[1] = imgtool_image_module(info->image)->description;
674674
675      global_free(utf8_file_title);
675      osd_free(utf8_file_title);
676676   }
677677   else
678678   {
r7938r7939
689689      TCHAR *t_tempstr = statusbar_text[i] ? tstring_from_utf8(statusbar_text[i]) : NULL;
690690      SendMessage(info->statusbar, SB_SETTEXT, i, (LPARAM) t_tempstr);
691691      if (t_tempstr)
692         global_free(t_tempstr);
692         osd_free(t_tempstr);
693693   }
694694
695695   // set the icon
r7938r7939
944944
945945done:
946946   if (tempstr)
947      free(tempstr);
947      osd_free(tempstr);
948948   return filerr;
949949}
950950
r7938r7939
10231023            _sntprintf(local_subpath, ARRAY_LENGTH(local_subpath), TEXT("%s\\%s"), local_path, wfd.cFileName);
10241024            filename = utf8_from_tstring(wfd.cFileName);
10251025            subpath = imgtool_partition_path_concatenate(partition, path, filename);
1026            free(filename);
1026            osd_free(filename);
10271027
10281028            if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
10291029            {
r7938r7939
10331033            {
10341034               char *tempstr = utf8_from_tstring(local_subpath);
10351035               err = imgtool_partition_put_file(partition, subpath, NULL, tempstr, NULL, NULL);
1036               free(tempstr);
1036               osd_free(tempstr);
10371037            }
10381038            if (err)
10391039               goto done;
r7938r7939
15531553      strcpy(s, info->current_directory);
15541554      strcat(s, "\\");
15551555      strcat(s, utf8_dirname);
1556      global_free(utf8_dirname);
1556      osd_free(utf8_dirname);
15571557      utf8_dirname = mame_strdup(s);
15581558   }
15591559
r7938r7939
15691569   if (err)
15701570      wimgtool_report_error(window, err, NULL, utf8_dirname);
15711571   if (utf8_dirname)
1572      global_free(utf8_dirname);
1572      osd_free(utf8_dirname);
15731573}
15741574
15751575
r7938r7939
17301730      if (err)
17311731         goto done;
17321732
1733      free(filename);
1733      osd_free(filename);
17341734      filename = NULL;
17351735   }
17361736
r7938r7939
17391739   if (err)
17401740      wimgtool_report_error(window, err, NULL, NULL);
17411741   if (filename)
1742      free(filename);
1742      osd_free(filename);
17431743}
17441744
17451745
src/mess/image.c
r7938r7939
16561656            gamedrv = driver_get_compatible(gamedrv);
16571657        }
16581658    }
1659   global_free(dst);
1659   osd_free(dst);
16601660}
16611661
16621662
src/mess/osd/windows/winutils.c
r7938r7939
8080         t_filter[i] = (buffer[i] != '|') ? buffer[i] : '\0';
8181      t_filter[i++] = '\0';
8282      t_filter[i++] = '\0';
83      free(buffer);
83      osd_free(buffer);
8484   }
8585
8686   // do we need to translate the file parameter?
r7938r7939
9393      t_file_size = MAX(_tcslen(buffer) + 1, MAX_PATH);
9494      t_file = (LPTSTR) alloca(t_file_size * sizeof(*t_file));
9595      _tcscpy(t_file, buffer);
96      free(buffer);
96      osd_free(buffer);
9797   }
9898
9999   // do we need to translate the initial directory?
r7938r7939
148148         goto done;
149149
150150      snprintf(ofn->filename, ARRAY_LENGTH(ofn->filename), "%s", utf8_file);
151      free(utf8_file);
151      osd_free(utf8_file);
152152   }
153153
154154   // we've completed the process
r7938r7939
156156
157157done:
158158   if (t_initial_directory != NULL)
159      free(t_initial_directory);
159      osd_free(t_initial_directory);
160160   return result;
161161}
162162
src/mess/osd/windows/dialog.c
r7938r7939
448448   w_str = str ? wstring_from_utf8(str) : NULL;
449449   rc = dialog_write_string(di, w_str);
450450   if (w_str)
451      global_free(w_str);
451      osd_free(w_str);
452452   if (rc)
453453      return 1;
454454
r7938r7939
676676
677677   w_title = wstring_from_utf8(title);
678678   rc = dialog_write_string(di, w_title);
679   global_free(w_title);
679   osd_free(w_title);
680680   if (rc)
681681      goto error;
682682
r7938r7939
823823      if( !t_tmp )
824824         return 1;
825825      t_item_label = win_dialog_tcsdup(dialog, t_tmp);
826      global_free(t_tmp);
826      osd_free(t_tmp);
827827      if (!t_item_label)
828828         return 1;
829829   }
src/mess/osd/windows/opcntrl.c
r7938r7939
8989                  goto unexpected;
9090               tempstr = tstring_from_utf8(guide[k].display_name);
9191               SendMessage(control, CB_ADDSTRING, 0, (LPARAM) tempstr);
92               free(tempstr);
92               osd_free(tempstr);
9393            }
9494            else
9595               goto unexpected;
src/mess/osd/windows/menu.c
r7938r7939
883883            has_option ? guide : NULL,
884884            has_option ? optspec : NULL);
885885      }
886      global_free(utf8_buf1);
886      osd_free(utf8_buf1);
887887   }
888888}
889889
r7938r7939
12591259      {
12601260         if (!get_menu_item_string(menu, ++i, TRUE, &sub_menu, buf, ARRAY_LENGTH(buf)))
12611261         {
1262            global_free(t_menutext);
1262            osd_free(t_menutext);
12631263            return NULL;
12641264         }
12651265      }
12661266      while(_tcscmp(t_menutext, buf));
12671267
1268      global_free(t_menutext);
1268      osd_free(t_menutext);
12691269
12701270      if (!sub_menu && create_sub_menu)
12711271      {
r7938r7939
15891589      TCHAR *t_view_name = tstring_from_utf8(view_name);
15901590      InsertMenu(video_menu, i, MF_BYPOSITION | (i == view_index ? MF_CHECKED : 0),
15911591         ID_VIDEO_VIEW_0 + i, t_view_name);
1592      global_free(t_view_name);
1592      osd_free(t_view_name);
15931593      i++;
15941594   }
15951595
r7938r7939
18001800   {
18011801      TCHAR *t_chapter = tstring_from_utf8(chapter);
18021802      htmlhelp(wnd, t_chapter, 0 /*HH_DISPLAY_TOPIC*/, 0);
1803      global_free(t_chapter);
1803      osd_free(t_chapter);
18041804   }
18051805}
18061806
r7938r7939
21462146   SetMenuItemInfo(menu_bar, command, FALSE, &mii);
21472147
21482148   // cleanup
2149   global_free(t_text);
2149   osd_free(t_text);
21502150}
21512151
21522152
src/mess/zippath.c
r7938r7939
359359   if (temp2 != NULL)
360360      astring_free(temp2);
361361   if (alloc_fullpath != NULL)
362      global_free(alloc_fullpath);
362      osd_free(alloc_fullpath);
363363   return filerr;
364364}
365365

Previous 15994 Revisions Next


© 1998-2018 The MESS Team