~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to hgfsmounter/hgfsmounter.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-10-23 15:32:00 UTC
  • mfrom: (1.1.2 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081023153200-gc1bfx89hj35c799
Tags: 2008.10.10-123053-2
* Correcting typo in dh_installinit call.
* Downgrading depends on module-assistant to recommends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
858
858
         break;
859
859
#endif
860
860
      case 'o':
861
 
         optionString = strdup(optarg);
 
861
         if (optionString == NULL) {
 
862
            optionString = strdup(optarg);
 
863
         } else {
 
864
            size_t newLength;
 
865
            char *savedString = optionString;
 
866
            newLength = strlen(optionString) + strlen(",") +
 
867
                        strlen(optarg) + sizeof '\0';
 
868
            optionString = realloc(optionString, newLength);
 
869
            if (optionString != NULL) {
 
870
               Str_Strcat(optionString, ",", newLength);
 
871
               Str_Strcat(optionString, optarg, newLength);
 
872
            } else {
 
873
               free(savedString);
 
874
            }
 
875
         }
862
876
         if (optionString == NULL) {
863
877
            printf("Error: could not allocate memory for options\n");
864
878
            goto out;